24 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// There should be no extra errors about missing 'template' keywords.4struct B {5 template <typename T>6 int f(){};7} builder; // expected-note 2{{'builder' declared here}}8 9auto a = bilder.f<int>(); // expected-error{{undeclared identifier 'bilder'; did you mean}}10auto b = (*(&bilder+0)).f<int>(); // expected-error{{undeclared identifier 'bilder'; did you mean}}11 12struct X {13 struct type {};14};15 16namespace PR48339 {17 struct S {18 template <typename T> static void g(typename T::type) {} // expected-note {{couldn't infer template argument 'T'}}19 template <typename T> void f() { g(typename T::type{}); } // expected-error {{no matching function for call to 'g'}}20 };21 22 void f() { S{}.f<X>(); } // expected-note {{in instantiation of}}23}24