// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -Wno-c++1y-extensions
// 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
;
// -- class template
void
T N0::X0<T>::member;
;
N0::X0<void> test_X0;
;
// -- variable template [C++1y]
using N0::v0;
int v1; // expected-note 4{{explicitly specialized declaration is here}}
extern int v1<char>;
extern int v1<char>;
extern int v1<char>;
extern int v1<char>;
int N0::v0<int>;
int v0<int>;
int ::v1<int>; // expected-warning {{extra qualification}}
int v1<int>;
int N0::v0<char>;
int v0<char>;
int ::v1<char>; // expected-warning {{extra qualification}}
int v1<char>;
// -- 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
;
;
void ;
void ;
;
;
void ;
;
void
int has_inline_namespaces::X0<X4>::value = 13;