]> granicus.if.org Git - clang/commitdiff
Workaround for compilers that don't implement C++ DR45, from Tom Honermann!
authorDouglas Gregor <dgregor@apple.com>
Wed, 9 Nov 2011 03:05:27 +0000 (03:05 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 9 Nov 2011 03:05:27 +0000 (03:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144161 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/PartialDiagnostic.h
include/clang/Parse/Parser.h

index ffebc2f99f58693bcf7bebbaa36edd4406c4dea4..60491231485752d0ca52e34237df4355f803b009 100644 (file)
@@ -25,6 +25,15 @@ namespace clang {
 
 class PartialDiagnostic {
 public:
+  enum {
+      // The MaxArguments and MaxFixItHints member enum values from
+      // DiagnosticsEngine are private but DiagnosticsEngine declares
+      // PartialDiagnostic a friend.  These enum values are redeclared
+      // here so that the nested Storage class below can access them.
+      MaxArguments = DiagnosticsEngine::MaxArguments,
+      MaxFixItHints = DiagnosticsEngine::MaxFixItHints
+  };
+
   struct Storage {
     Storage() : NumDiagArgs(0), NumDiagRanges(0), NumFixItHints(0) { }
 
@@ -33,7 +42,7 @@ public:
         /// currently only support up to 10 arguments (%0-%9).
         /// A single diagnostic with more than that almost certainly has to
         /// be simplified anyway.
-        MaxArguments = DiagnosticsEngine::MaxArguments
+        MaxArguments = PartialDiagnostic::MaxArguments
     };
 
     /// NumDiagArgs - This contains the number of entries in Arguments.
@@ -65,7 +74,7 @@ public:
     /// only support 10 ranges, could easily be extended if needed.
     CharSourceRange DiagRanges[10];
 
-    enum { MaxFixItHints = DiagnosticsEngine::MaxFixItHints };
+    enum { MaxFixItHints = PartialDiagnostic::MaxFixItHints };
 
     /// FixItHints - If valid, provides a hint with some code
     /// to insert, remove, or modify at a particular position.
index 1b369d0ed38c22356b382bbc402561bc612e90ac..ff7a9b2d3455265a81b50eef967243e85df4a245 100644 (file)
@@ -414,11 +414,14 @@ private:
     return PP.LookAhead(0);
   }
 
+  class BalancedDelimiterTracker;
+
   /// \brief Tracks information about the current nesting depth of 
   /// opening delimiters of each kind.
   class DelimiterTracker {
   private:
     friend class Parser;
+    friend class BalancedDelimiterTracker;
 
     unsigned Paren, Brace, Square, Less, LLLess;
     unsigned& get(tok::TokenKind t) {