diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-01 21:51:26 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-01 21:51:26 +0000 |
commit | 31a19b6989bbf326d2de5ae12e712e2a65ca9c34 (patch) | |
tree | e79ad32f23a5f590558c274cf11b000f10b04042 /test/SemaCXX/using-directive.cpp | |
parent | faa435a326a694e0517d035376e616ff82655fe5 (diff) |
Make parsing a semantic analysis a little more robust following Sema
failures that involve malformed types, e.g., "typename X::foo" where
"foo" isn't a type, or "std::vector<void>" that doens't instantiate
properly.
Similarly, be a bit smarter in our handling of ambiguities that occur
in Sema::getTypeName, to eliminate duplicate error messages about
ambiguous name lookup.
This eliminates two XFAILs in test/SemaCXX, one of which was crying
out to us, trying to tell us that we were producing repeated error
messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/using-directive.cpp')
-rw-r--r-- | test/SemaCXX/using-directive.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/SemaCXX/using-directive.cpp b/test/SemaCXX/using-directive.cpp index 767b49b76f..324052f190 100644 --- a/test/SemaCXX/using-directive.cpp +++ b/test/SemaCXX/using-directive.cpp @@ -1,9 +1,7 @@ // RUN: clang-cc -fsyntax-only -verify %s -// XFAIL -// fails due to exact diagnostic matching namespace A { - short i; // expected-note{{candidate found by name lookup is 'A::i'}} + short i; // expected-note 2{{candidate found by name lookup is 'A::i'}} namespace B { long i; // expected-note{{candidate found by name lookup is 'A::B::i'}} void f() {} // expected-note{{candidate function}} @@ -58,7 +56,7 @@ void K1::foo() {} // okay // FIXME: Do we want err_ovl_no_viable_function_in_init here? struct K2 k2; // expected-error{{reference to 'K2' is ambiguous}} \ - expected-error{{no matching constructor}} + expected-error{{incomplete type}} // FIXME: This case is incorrectly diagnosed! //K2 k3; @@ -66,7 +64,7 @@ struct K2 k2; // expected-error{{reference to 'K2' is ambiguous}} \ class X { // expected-note{{candidate found by name lookup is 'X'}} // FIXME: produce a suitable error message for this - using namespace A; // expected-error{{expected unqualified-id}} + using namespace A; // expected-error{{expected member name or}} }; namespace N { @@ -96,7 +94,8 @@ namespace OneFunction { } namespace TwoTag { - struct X; // expected-note{{candidate found by name lookup is 'TwoTag::X'}} + struct X; // expected-note{{candidate found by name lookup is 'TwoTag::X'}} \ + // expected-note{{forward declaration}} } namespace FuncHidesTagAmbiguity { @@ -105,6 +104,7 @@ namespace FuncHidesTagAmbiguity { using namespace TwoTag; void test() { - (void)X(); // expected-error{{reference to 'X' is ambiguous}} + (void)X(); // expected-error{{reference to 'X' is ambiguous}} \ + // FIXME: expected-error{{invalid use of incomplete type}} } } |