// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors namespace dr727 { // dr727: partial struct A { template struct C; // expected-note 6{{here}} template void f(); // expected-note {{here}} template static int N; // expected-error 0-1{{C++14}} expected-note 6{{here}} template<> struct C; template<> void f(); template<> static int N; template struct C; template static int N; struct B { template<> struct C; // expected-error {{not in class 'A' or an enclosing namespace}} template<> void f(); // expected-error {{no function template matches}} template<> static int N; // expected-error {{not in class 'A' or an enclosing namespace}} template struct C; // expected-error {{not in class 'A' or an enclosing namespace}} template static int N; // expected-error {{not in class 'A' or an enclosing namespace}} template<> struct A::C; // expected-error {{not in class 'A' or an enclosing namespace}} template<> void A::f(); // expected-error {{no function template matches}} expected-error {{cannot have a qualified name}} template<> static int A::N; // expected-error {{not in class 'A' or an enclosing namespace}} expected-error {{cannot have a qualified name}} template struct A::C; // expected-error {{not in class 'A' or an enclosing namespace}} template static int A::N; // expected-error {{not in class 'A' or an enclosing namespace}} expected-error {{cannot have a qualified name}} }; }; template<> struct A::C; template<> void A::f(); template<> int A::N; template struct A::C; template int A::N; namespace C { template<> struct A::C; // expected-error {{not in class 'A' or an enclosing namespace}} template<> void A::f(); // expected-error {{not in class 'A' or an enclosing namespace}} template<> int A::N; // expected-error {{not in class 'A' or an enclosing namespace}} template struct A::C; // expected-error {{not in class 'A' or an enclosing namespace}} template int A::N; // expected-error {{not in class 'A' or an enclosing namespace}} } template struct D { template struct C { typename T::error e; }; // expected-error {{no members}} template void f() { T::error; } // expected-error {{no members}} template static const int N = T::error; // expected-error 2{{no members}} expected-error 0-1{{C++14}} template<> struct C {}; template<> void f() {} template<> static const int N; template struct C {}; template static const int N; }; void d(D di) { D::C(); di.f(); int a = D::N; // FIXME: expected-note {{instantiation of}} D::C(); int b = D::N; D::C(); // expected-note {{instantiation of}} di.f(); // expected-note {{instantiation of}} int c = D::N; // expected-note {{instantiation of}} } } namespace dr777 { // dr777: 3.7 #if __cplusplus >= 201103L template void f(int i = 0, T ...args) {} void ff() { f(); } template void g(int i = 0, T ...args, T ...args2) {} template void h(int i = 0, T ...args, int j = 1) {} #endif }