For
void f( a::b::c );
we would cache the tokens "a::b::" but then we would try to annotate them using the range "a::".
Before annotating them with the (invalid) C++ scope spec, set it to the range of "a::b::".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106536
91177308-0d34-0410-b5e6-
96231b3b80d8
HasScopeSpecifier = true;
}
- if (SS.isInvalid())
- continue;
-
- SS.setScopeRep(
- Actions.ActOnCXXNestedNameSpecifier(CurScope, SS, IdLoc, CCLoc, II,
- ObjectType, EnteringContext));
+ if (!SS.isInvalid())
+ SS.setScopeRep(
+ Actions.ActOnCXXNestedNameSpecifier(CurScope, SS, IdLoc, CCLoc, II,
+ ObjectType, EnteringContext));
SS.setEndLoc(CCLoc);
continue;
}
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
+// PR7180
+int f(a::b::c); // expected-error {{use of undeclared identifier 'a'}}
+
class Foo::Bar { // expected-error {{use of undeclared identifier 'Foo'}} \
// expected-note {{to match this '{'}} \
// expected-error {{expected ';' after class}}