diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-23 20:19:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-23 20:19:14 +0000 |
commit | 40b2e19cae6ab85407856c70f76278f9efbeeb7c (patch) | |
tree | 33b64a284db290fe463964aaccecf55beff1026c /test/Parser/cxx-ambig-decl-expr.cpp | |
parent | 42b60551eff3a424e191b293bfd606559dc96bff (diff) |
When disambiguating an expression-statement from a declaraton-statement, if the
statement starts with an identifier for which name lookup will fail either way,
look at later tokens to disambiguate in order to improve error recovery.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-ambig-decl-expr.cpp')
-rw-r--r-- | test/Parser/cxx-ambig-decl-expr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/Parser/cxx-ambig-decl-expr.cpp b/test/Parser/cxx-ambig-decl-expr.cpp index b5ff728b47..feb185fbe3 100644 --- a/test/Parser/cxx-ambig-decl-expr.cpp +++ b/test/Parser/cxx-ambig-decl-expr.cpp @@ -7,4 +7,7 @@ struct X { void f() { void (*ptr)(int, int) = &X::f<int, int>; + + unknown *p = 0; // expected-error {{unknown type name 'unknown'}} + unknown * p + 0; // expected-error {{undeclared identifier 'unknown'}} } |