Improve diagnostics when the parser encounters a declarator with an
unknown type name, e.g.,
foo::bar x;
when "bar" does not refer to a type in "foo".
With this change, the parser now calls into the action to perform
diagnostics and can try to recover by substituting in an appropriate
type. For example, this allows us to easily diagnose some missing
"typename" specifiers, which we now do:
test/SemaCXX/unknown-type-name.cpp:29:1: error: missing 'typename'
prior to dependent type name 'A<T>::type'
A<T>::type A<T>::f() { return type(); }
^~~~~~~~~~
typename
Fixes PR3990.
llvm-svn: 84053
diff --git a/clang/test/SemaCXX/namespace.cpp b/clang/test/SemaCXX/namespace.cpp
index ae8dfc5..5ed6ba5 100644
--- a/clang/test/SemaCXX/namespace.cpp
+++ b/clang/test/SemaCXX/namespace.cpp
@@ -67,4 +67,4 @@
static foo::x test1; // ok
-static foo::X test2; // typo: expected-error {{unknown type name 'X'}}
+static foo::X test2; // typo: expected-error {{no type named 'X' in}}