summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-04-27 04:48:22 +0000
committerDouglas Gregor <dgregor@apple.com>2011-04-27 04:48:22 +0000
commit8b02cd0beae6e38273afb9d339489f6bb59b8bde (patch)
treea6d3229f872d0d9cac8039d0283c4ebbd509f82f /clang/lib/Parse/Parser.cpp
parentc5d3ba1aad51caed70e0f2e6e52fe6d4436bcae4 (diff)
downloadbcm5719-llvm-8b02cd0beae6e38273afb9d339489f6bb59b8bde.tar.gz
bcm5719-llvm-8b02cd0beae6e38273afb9d339489f6bb59b8bde.zip
Extend Sema::ClassifyName() to support C++, ironing out a few issues
in the classification of template names and using declarations. We now properly typo-correct the leading identifiers in statements to types, templates, values, etc. As an added bonus, this reduces the number of lookups required for disambiguation. llvm-svn: 130288
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index debc7404b91..ee4ef4263a2 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -1255,7 +1255,8 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext) {
bool Parser::TryAnnotateCXXScopeToken(bool EnteringContext) {
assert(getLang().CPlusPlus &&
"Call sites of this function should be guarded by checking for C++");
- assert((Tok.is(tok::identifier) || Tok.is(tok::coloncolon)) &&
+ assert((Tok.is(tok::identifier) || Tok.is(tok::coloncolon) ||
+ (Tok.is(tok::annot_template_id) && NextToken().is(tok::coloncolon)))&&
"Cannot be a type or scope token!");
CXXScopeSpec SS;
OpenPOWER on IntegriCloud