that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because the CachedTokens that holds them will be deleted while the lexer is still using them. Make sure that the tokens of default args are removed from the token stream. Fixes PR6647. llvm-svn: 99939
10 lines
305 B
C++
10 lines
305 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// PR6647
|
|
class C {
|
|
// After the error, the rest of the tokens inside the default arg should be
|
|
// skipped, avoiding a "expected ';' after class" after 'undecl'.
|
|
void m(int x = undecl + 0); // expected-error {{use of undeclared identifier 'undecl'}}
|
|
};
|
|
|