diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-13 23:27:22 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-13 23:27:22 +0000 |
commit | a786fdbf6c1d8ff08c3e61c7eb6bf2872895e2b4 (patch) | |
tree | ff286b08556defd04e78be347cdf3adfbe6425ce /lib/Sema/Sema.cpp | |
parent | 15934f92c3b56aa8275d3d77d7b884088ff5d4a7 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index c289abfea8..ba05a07f26 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -117,6 +117,7 @@ static void ConvertArgToStringFn(Diagnostic::ArgumentKind Kind, intptr_t Val, llvm::raw_string_ostream OS(S); reinterpret_cast<NestedNameSpecifier*> (Val)->print(OS, Context.PrintingPolicy); + NeedQuotes = false; } else { assert(Kind == Diagnostic::ak_declcontext); DeclContext *DC = reinterpret_cast<DeclContext *> (Val); |