Douglas Gregor | 3a348c8 | 2011-07-14 04:54:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
| 3 | // FIXME: The diagnostics and recovery here are very, very poor. |
| 4 | |
| 5 | // PR10355 |
Kaelyn Uhrain | f0c1d8f | 2011-08-03 20:36:05 +0000 | [diff] [blame] | 6 | template<typename T> void template_id1() { // expected-note {{'template_id1' declared here}} \ |
John McCall | 6dbba4f | 2011-10-11 23:14:30 +0000 | [diff] [blame] | 7 | // expected-note {{possible target for call}} |
Kaelyn Uhrain | f0c1d8f | 2011-08-03 20:36:05 +0000 | [diff] [blame] | 8 | template_id2<> t; // expected-error {{no template named 'template_id2'; did you mean 'template_id1'?}} \ |
| 9 | // expected-error {{expected ';' after expression}} \ |
John McCall | 6dbba4f | 2011-10-11 23:14:30 +0000 | [diff] [blame] | 10 | // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}} \ |
Kaelyn Uhrain | f0c1d8f | 2011-08-03 20:36:05 +0000 | [diff] [blame] | 11 | // expected-error {{use of undeclared identifier 't'}} |
Douglas Gregor | 3a348c8 | 2011-07-14 04:54:23 +0000 | [diff] [blame] | 12 | } |
Douglas Gregor | 0179868 | 2012-03-26 16:54:18 +0000 | [diff] [blame] | 13 | |
| 14 | // FIXME: It would be nice if we could get this correction right. |
| 15 | namespace PR12297 { |
| 16 | namespace A { |
| 17 | typedef short T; |
| 18 | |
| 19 | namespace B { |
| 20 | typedef short T; |
| 21 | |
Kaelyn Uhrain | 6d858d9 | 2012-04-03 18:20:11 +0000 | [diff] [blame^] | 22 | T global(); // expected-note {{'A::B::global' declared here}} |
Douglas Gregor | 0179868 | 2012-03-26 16:54:18 +0000 | [diff] [blame] | 23 | } |
| 24 | } |
| 25 | |
| 26 | using namespace A::B; |
| 27 | |
Kaelyn Uhrain | 6d858d9 | 2012-04-03 18:20:11 +0000 | [diff] [blame^] | 28 | T A::global(); // expected-error {{out-of-line definition of 'global' does not match any declaration in namespace 'PR12297::A'; did you mean 'A::B::global'?}} |
Douglas Gregor | 0179868 | 2012-03-26 16:54:18 +0000 | [diff] [blame] | 29 | } |