From 869c6610c78c2af8ac407a2eed037f68c990be70 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 12 Apr 2009 22:23:27 +0000 Subject: Fix some C++ error recovery problems in init declarator parsing that I noticed working on other things. Instead of emitting: t2.cc:1:8: error: use of undeclared identifier 'g' int x(*g); ^ t2.cc:1:10: error: expected ')' int x(*g); ^ t2.cc:1:6: note: to match this '(' int x(*g); ^ We now only emit: t2.cc:1:7: warning: type specifier missing, defaults to 'int' int x(*g); ^ Note that the example in SemaCXX/nested-name-spec.cpp:f4 is still not great, we now produce both of: void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} \ expected-error {{variable has incomplete type 'void'}} The second diagnostic should be silenced by something getting marked invalid. I don't plan to fix this though. llvm-svn: 68919 --- clang/test/Parser/cxx-decl.cpp | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 clang/test/Parser/cxx-decl.cpp (limited to 'clang/test/Parser/cxx-decl.cpp') diff --git a/clang/test/Parser/cxx-decl.cpp b/clang/test/Parser/cxx-decl.cpp new file mode 100644 index 00000000000..3fa284282ad --- /dev/null +++ b/clang/test/Parser/cxx-decl.cpp @@ -0,0 +1,3 @@ +// RUN: clang-cc -verify -fsyntax-only %s + +int x(*g); // expected-error {{use of undeclared identifier 'g'}} -- cgit v1.2.3