// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s namespace PR15360 { template U f() { return &F; } // expected-error{{cannot take the address of an rvalue of type 'int (*)(int)'}} expected-error{{cannot take the address of an rvalue of type 'int *'}} void test() { f(); // expected-note{{in instantiation of}} f(); // expected-note{{in instantiation of}} } } namespace CanonicalNullptr { template struct get { typedef T type; }; struct X {}; template::type P = nullptr> struct A {}; template::type P = nullptr> struct B {}; template::type P = nullptr> struct C {}; template A MakeA(); template B MakeB(); template C MakeC(); A a = MakeA(); B b = MakeB(); C c = MakeC(); } namespace Auto { template struct A { }; // expected-error {{until C++17}} } namespace check_conversion_early { struct X {}; template struct A {}; template struct A {}; // expected-error {{not implicitly convertible}} struct Y { constexpr operator int() const { return 0; } }; template struct A {}; // expected-error {{cannot be deduced}} expected-note {{'y'}} } namespace ReportCorrectParam { template void TempFunc() {} void Useage() { //expected-error@+2 {{no matching function}} //expected-note@-4 {{candidate template ignored: invalid explicitly-specified argument for template parameter 'b'}} TempFunc<1, -1, 1>(); } } namespace PR42513 { template void f(); constexpr int WidgetCtor(struct X1*); struct X1 { friend constexpr int WidgetCtor(X1*); }; template struct StandardWidget { friend constexpr int WidgetCtor(X1*) { return 0; } }; template struct StandardWidget; void use() { f(); } }