// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
// This test creates cases where implicit instantiations of various entities
// would cause a diagnostic, but provides expliict specializations for those
// entities that avoid the diagnostic. The specializations are alternately
// declarations and definitions, and the intent of this test is to verify
// that we allow specializations only in the appropriate namespaces (and
// nowhere else).
;
// C++ [temp.expl.spec]p1:
// An explicit specialization of any of the following:
// -- function template
void // okay
void ;
void
;
// -- class template
void
T N0::X0<T>::member;
;
N0::X0<void> test_X0;
;
// -- member function of a class template
void
void
void
// -- static data member of a class template
NonDefaultConstructible &
int N0::X0<int>::member;
float N0::X0<float>::member = 3.14f;
// -- member class of a class template
;
;
;
N0::X0<void*>::Inner inner0;
N0::X0<int>::Inner inner1;
N0::X0<long>::Inner inner2;
N0::X0<float>::Inner inner3;
N0::X0<double>::Inner inner4; // expected-error{{incomplete}}
// -- member class template of a class template
; // okay
;
N0::X0<void*>::InnerTemplate<int> inner_template0;
N0::X0<int>::InnerTemplate<int> inner_template1; // expected-error{{incomplete}}
N0::X0<int>::InnerTemplate<long> inner_template2;
N0::X0<int>::InnerTemplate<unsigned long> inner_template3; // expected-note{{instantiation}}
// -- member function template of a class template
void // okay
void
void