forked from OSchip/llvm-project
Fix PR7180.
For void f( a:🅱️:c ); we would cache the tokens "a:🅱️:" 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:🅱️:". llvm-svn: 106536
This commit is contained in:
parent
104819c6eb
commit
75000b6814
|
@ -278,12 +278,10 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// 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}}
|
||||
|
|
Loading…
Reference in New Issue