xref: /minix3/external/bsd/llvm/dist/clang/test/SemaTemplate/dependent-names-no-std.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc //
3*f4a2713aSLionel Sambuc // The whole point of this test is to verify certain diagnostics work in the
4*f4a2713aSLionel Sambuc // absence of namespace 'std'.
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc namespace PR10053 {
7*f4a2713aSLionel Sambuc   namespace ns {
8*f4a2713aSLionel Sambuc     struct Data {};
9*f4a2713aSLionel Sambuc   }
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc   template<typename T> struct A {
12*f4a2713aSLionel Sambuc     T t;
APR10053::A13*f4a2713aSLionel Sambuc     A() {
14*f4a2713aSLionel Sambuc       f(t); // expected-error {{call to function 'f' that is neither visible in the template definition nor found by argument-dependent lookup}}
15*f4a2713aSLionel Sambuc     }
16*f4a2713aSLionel Sambuc   };
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc   void f(ns::Data); // expected-note {{in namespace 'PR10053::ns'}}
19*f4a2713aSLionel Sambuc 
20*f4a2713aSLionel Sambuc   A<ns::Data> a; // expected-note {{in instantiation of member function}}
21*f4a2713aSLionel Sambuc }
22