blob: 4ea63c542a89e5446f121fc8bc73bb98da9db9b6 [file] [log] [blame]
Douglas Gregor5cf0e152011-07-14 04:54:23 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// FIXME: The diagnostics and recovery here are very, very poor.
4
5// PR10355
Kaelyn Uhrainacbdc572011-08-03 20:36:05 +00006template<typename T> void template_id1() { // expected-note {{'template_id1' declared here}} \
John McCall50a2c2c2011-10-11 23:14:30 +00007 // expected-note {{possible target for call}}
Kaelyn Uhrainacbdc572011-08-03 20:36:05 +00008 template_id2<> t; // expected-error {{no template named 'template_id2'; did you mean 'template_id1'?}} \
9 // expected-error {{expected ';' after expression}} \
John McCall50a2c2c2011-10-11 23:14:30 +000010 // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}} \
Kaelyn Uhrainacbdc572011-08-03 20:36:05 +000011 // expected-error {{use of undeclared identifier 't'}}
Douglas Gregor5cf0e152011-07-14 04:54:23 +000012 }
Douglas Gregorb11f9452012-03-26 16:54:18 +000013
14// FIXME: It would be nice if we could get this correction right.
15namespace PR12297 {
16 namespace A {
17 typedef short T;
18
19 namespace B {
20 typedef short T;
21
Kaelyn Uhrainb18b0c02013-07-02 23:47:35 +000022 T global(); // expected-note {{'::PR12297::global' declared here}}
Douglas Gregorb11f9452012-03-26 16:54:18 +000023 }
24 }
25
26 using namespace A::B;
27
Kaelyn Uhrainb18b0c02013-07-02 23:47:35 +000028 // FIXME: Adding '::PR12297::' is not needed as removing 'A::' is sufficient
Richard Smith114394f2013-08-09 04:35:01 +000029 T A::global(); // expected-error {{out-of-line declaration of 'global' does not match any declaration in namespace 'PR12297::A'; did you mean '::PR12297::global'?}}
Douglas Gregorb11f9452012-03-26 16:54:18 +000030}