]> granicus.if.org Git - clang/commitdiff
Fix a bug where we'd try to look beyond the current cached tokens when
authorChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 01:42:04 +0000 (01:42 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 01:42:04 +0000 (01:42 +0000)
not in backtracking mode.  This was just using the wrong predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61666 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Preprocessor.h
lib/Parse/ParseExprCXX.cpp
test/SemaCXX/qualified-id-lookup.cpp

index efe057e33478d84dc012918bc4d274b0e680f964..54dc1b62df0d65a743f86e630dc8ab169341b9b1 100644 (file)
@@ -414,7 +414,7 @@ public:
   /// invoked.
   void AnnotateCachedTokens(const Token &Tok) {
     assert(Tok.isAnnotationToken() && "Expected annotation token");
-    if (CachedLexPos != 0 && InCachingLexMode())
+    if (CachedLexPos != 0 && isBacktrackEnabled())
       AnnotatePreviousCachedTokens(Tok);
   }
   
index a4b97e173be49c1cca69520103cba527c1013765..5e50bf8859407eb99afb4d0c918ccc23a4d1c4e7 100644 (file)
@@ -68,8 +68,8 @@ bool Parser::MaybeParseCXXScopeSpecifier(CXXScopeSpec &SS,
       SourceLocation CCLoc = ConsumeToken();
       
       // ::new and ::delete aren't nested-name-specifiers, and 
-      // MaybeParseCXXScopeSpecifier is never called in a context where one could
-      // exist.  This means that if we see it, we have a syntax error.
+      // MaybeParseCXXScopeSpecifier is never called in a context where one
+      // could exist.  This means that if we see it, we have a syntax error.
       if (Tok.is(tok::kw_new) || Tok.is(tok::kw_delete)) {
         Diag(Tok, diag::err_invalid_qualified_new_delete)
           << Tok.is(tok::kw_delete);
index d0bb338e873cd568e0b734d6223181830f23ede5..064f5c90934860dad9b3522bac66041075054da6 100644 (file)
@@ -53,3 +53,14 @@ void test_f1(int i) {
   int v3 = ::i1;
 }
 
+typedef int f2_type;
+namespace a {
+  typedef int f2_type(int, int);
+
+  void test_f2() {
+    ::f2_type(1, 2); // expected-error {{function-style cast to a builtin type can only take one argument}}
+  }
+}
+
+
+