aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Lex/Preprocessor.h2
-rw-r--r--lib/Parse/ParseExprCXX.cpp4
-rw-r--r--test/SemaCXX/qualified-id-lookup.cpp11
3 files changed, 14 insertions, 3 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index efe057e334..54dc1b62df 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -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);
}
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp
index a4b97e173b..5e50bf8859 100644
--- a/lib/Parse/ParseExprCXX.cpp
+++ b/lib/Parse/ParseExprCXX.cpp
@@ -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);
diff --git a/test/SemaCXX/qualified-id-lookup.cpp b/test/SemaCXX/qualified-id-lookup.cpp
index d0bb338e87..064f5c9093 100644
--- a/test/SemaCXX/qualified-id-lookup.cpp
+++ b/test/SemaCXX/qualified-id-lookup.cpp
@@ -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}}
+ }
+}
+
+
+