Make tentative parsing of pointer-to-member decls work, and fix other stuff pointed out by Doug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62944 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index a7c3e38..e7914cc 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/lib/Parse/ParseTentative.cpp
@@ -357,7 +357,7 @@
/// '*' cv-qualifier-seq[opt]
/// '&'
/// [C++0x] '&&' [TODO]
-/// '::'[opt] nested-name-specifier '*' cv-qualifier-seq[opt] [TODO]
+/// '::'[opt] nested-name-specifier '*' cv-qualifier-seq[opt]
///
/// cv-qualifier-seq:
/// cv-qualifier cv-qualifier-seq[opt]
@@ -387,8 +387,12 @@
// ptr-operator declarator
while (1) {
- if (Tok.is(tok::star) || Tok.is(tok::amp) ||
- (Tok.is(tok::caret) && getLang().Blocks)) {
+ if (Tok.is(tok::coloncolon) || Tok.is(tok::identifier))
+ TryAnnotateCXXScopeToken();
+
+ if (Tok.is(tok::star) || Tok.is(tok::amp) ||
+ (Tok.is(tok::caret) && getLang().Blocks) ||
+ (Tok.is(tok::annot_cxxscope) && NextToken().is(tok::star))) {
// ptr-operator
ConsumeToken();
while (Tok.is(tok::kw_const) ||