summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-04-27 05:41:15 +0000
committerDouglas Gregor <dgregor@apple.com>2011-04-27 05:41:15 +0000
commit19b7acff10846907a07dc104e18c0fe72bafb3c7 (patch)
treef9640afb7c41b6cd1b764fd9bc92845faf48c009 /clang/lib/Parse/ParseDecl.cpp
parent08b434f4503ec60b351bff9a7aeca26e5b6dfa4b (diff)
downloadbcm5719-llvm-19b7acff10846907a07dc104e18c0fe72bafb3c7.tar.gz
bcm5719-llvm-19b7acff10846907a07dc104e18c0fe72bafb3c7.zip
Simplify the parser's handling of Sema::ClassifyName() for types, by
creating a type-annotation token rather than jumping into the declaration parsing. llvm-svn: 130293
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index c09a93a84f1..a021b84d157 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -2954,9 +2954,6 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
case tok::kw_virtual:
case tok::kw_explicit:
- // typedef-name
- case tok::annot_typename:
-
// static_assert-declaration
case tok::kw__Static_assert:
@@ -2971,6 +2968,11 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
case tok::less:
return getLang().ObjC1;
+ // typedef-name
+ case tok::annot_typename:
+ return !DisambiguatingWithExpression ||
+ !isStartOfObjCClassMessageMissingOpenBracket();
+
case tok::kw___declspec:
case tok::kw___cdecl:
case tok::kw___stdcall:
OpenPOWER on IntegriCloud