// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -Wc++11-compat %s
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -Wc++11-compat -std=c++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=c++11 %s
//
// Tests explicit instantiation of templates.
;
// Check the syntax of explicit instantiations.
;
; // expected-note{{previous}}
;
;
using namespace N;
// Check for some bogus syntax that probably means that the user
// wanted to write an explicit specialization, but forgot the '<>'
// after 'template'.
; // expected-error{{explicit specialization}}
// Check for explicit instantiations that come after other kinds of
// instantiations or declarations.
; // expected-error{{duplicate}}
; // expected-note{{previous}}
; // expected-warning{{has no effect}}
void
;
// Check that explicit instantiations actually produce definitions. We
// determine whether this happens by placing semantic errors in the
// definition of the template we're instantiating.
; // expected-note{{declared here}}
; // expected-error{{undefined template}}
;
; // okay
; // expected-note{{in instantiation of}}
// Check that explicit instantiations instantiate member classes.
;
void ; // okay, Inner, not instantiated
; // expected-note{{instantiation}}
;
void ; // okay, Inner, not instantiated
void ; // okay, Inner::VeryInner, not instantiated
; // expected-note{{instantiation}}
; // expected-note{{instantiation}}
// Check explicit instantiation of member classes
;
using namespace N2;
; // expected-note{{instantiation}}
void ;
; // expected-note{{instantiation}}
;
; // expected-error{{non-templated}}
// PR5559
;
;
// expected-warning{{extraneous template parameter list}}
;
; // expected-note{{here}}
;