[cfe-commits] r144161 - in /cfe/trunk/include/clang: Basic/PartialDiagnostic.h Parse/Parser.h
Douglas Gregor
dgregor at apple.com
Tue Nov 8 19:05:27 PST 2011
Author: dgregor
Date: Tue Nov 8 21:05:27 2011
New Revision: 144161
URL: http://llvm.org/viewvc/llvm-project?rev=144161&view=rev
Log:
Workaround for compilers that don't implement C++ DR45, from Tom Honermann!
Modified:
cfe/trunk/include/clang/Basic/PartialDiagnostic.h
cfe/trunk/include/clang/Parse/Parser.h
Modified: cfe/trunk/include/clang/Basic/PartialDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/PartialDiagnostic.h?rev=144161&r1=144160&r2=144161&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/PartialDiagnostic.h (original)
+++ cfe/trunk/include/clang/Basic/PartialDiagnostic.h Tue Nov 8 21:05:27 2011
@@ -25,6 +25,15 @@
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 @@
/// 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 @@
/// 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.
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=144161&r1=144160&r2=144161&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Tue Nov 8 21:05:27 2011
@@ -414,11 +414,14 @@
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) {
More information about the cfe-commits
mailing list