1 // RUN: %clang_cc1 -fsyntax-only -verify %s
6 template<typename T> struct A {
14 S::A<int>::Nested::type *ip = &i;
26 template<typename V> T bar(V);
27 template<typename V> T* bar(V);
36 class Outer<X>::Inner0 {
43 void Outer<X>::Inner0<Y>::f(X, Y) {
48 struct Outer<X>::Inner1<Y>::ReallyInner {
56 void Outer<X>::Inner1<Y>::ReallyInner::g(X, Y) {
61 X Outer<X>::Inner1<Y>::foo(Y) {
68 X Outer<X>::Inner1<Y>::bar(Z) {
75 X* Outer<X>::Inner1<Y>::bar(Z) {
81 X Outer<X>::Inner1<Y>::value1 = 0;
85 Y Outer<X>::Inner1<Y>::value2 = Y();
89 Y Outer<X>::Inner1<Y>::ReallyInner::value3 = Y();
93 Y Outer<X>::Inner1<Y*>::ReallyInner::value4; // expected-error{{Outer<X>::Inner1<Y *>::ReallyInner::}}
102 void f(U u = T()) { }
108 template<typename, bool = false> struct B { };
110 template struct X1<int>::B<bool>;
112 // Template template parameters
115 template<template<class U, T Value> class> // expected-error{{cannot have type 'float'}} \
116 // expected-note{{previous non-type template}}
121 int Value> // expected-note{{template non-type parameter}}
124 X2<int>::Inner<X2_arg> x2i1;
125 X2<float> x2a; // expected-note{{instantiation}}
126 X2<long>::Inner<X2_arg> x2i3; // expected-error{{template template argument has different}}
129 template<typename TN>
137 T SomeField; // expected-error {{member 'SomeField' declared as a template}}
138 template<> int SomeField2; // expected-error {{extraneous 'template<>' in declaration of member 'SomeField2'}}
148 template< class Topology, class ctype >
149 struct ReferenceElement
153 template< class Topology, class ctype >
154 template< int codim >
155 class ReferenceElement< Topology, ctype > :: BaryCenterArray // expected-error{{out-of-line definition of 'BaryCenterArray' does not match any declaration in 'ReferenceElement<Topology, ctype>'}}
161 template <typename T> struct X;
162 template <typename T> int X<T>::func() {} // expected-error{{out-of-line definition of 'func' from class 'X<T>' without definition}}
166 template<const int &...N> struct A { template<typename ...T> void f(T (&...t)[N]); };
167 constexpr int k = 10;
169 void g() { A<k>().f(arr); }