xref: /minix3/external/bsd/llvm/dist/clang/test/FixIt/typo-crash.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // FIXME: The diagnostics and recovery here are very, very poor.
4*f4a2713aSLionel Sambuc 
5*f4a2713aSLionel Sambuc // PR10355
template_id1()6*f4a2713aSLionel Sambuc template<typename T> void template_id1() { // expected-note {{'template_id1' declared here}} \
7*f4a2713aSLionel Sambuc   // expected-note {{possible target for call}}
8*f4a2713aSLionel Sambuc   template_id2<> t; // expected-error {{no template named 'template_id2'; did you mean 'template_id1'?}} \
9*f4a2713aSLionel Sambuc   // expected-error {{expected ';' after expression}} \
10*f4a2713aSLionel Sambuc   // expected-error {{reference to overloaded function could not be resolved; did you mean to call it?}} \
11*f4a2713aSLionel Sambuc   // expected-error {{use of undeclared identifier 't'}}
12*f4a2713aSLionel Sambuc  }
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc // FIXME: It would be nice if we could get this correction right.
15*f4a2713aSLionel Sambuc namespace PR12297 {
16*f4a2713aSLionel Sambuc   namespace A {
17*f4a2713aSLionel Sambuc     typedef short   T;
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc     namespace B {
20*f4a2713aSLionel Sambuc       typedef short   T;
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc       T global(); // expected-note {{'::PR12297::global' declared here}}
23*f4a2713aSLionel Sambuc     }
24*f4a2713aSLionel Sambuc   }
25*f4a2713aSLionel Sambuc 
26*f4a2713aSLionel Sambuc   using namespace A::B;
27*f4a2713aSLionel Sambuc 
28*f4a2713aSLionel Sambuc   // FIXME: Adding '::PR12297::' is not needed as removing 'A::' is sufficient
29*f4a2713aSLionel Sambuc   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'?}}
30*f4a2713aSLionel Sambuc }
31