1 // RUN: %clang_cc1 -std=c++98 -verify %s 2 3 template<int n> struct S; 4 5 template<int n> struct T { TT6 T() { 7 // An identifier is value-dependent if it is: 8 // - a name declared with a dependent type 9 S<n> s; 10 S<s> check1; // ok, s is value-dependent 11 // - the name of a non-type template parameter 12 typename S<n>::T check2; // ok, n is value-dependent 13 // - a constant with literal type and is initialized with an expression 14 // that is value-dependent. 15 const int k = n; 16 typename S<k>::T check3; // ok, u is value-dependent 17 18 const int &i = k; 19 typename S<i>::T check4; // expected-error {{not an integral constant expression}} expected-error {{qualified name}} 20 } 21 }; 22