brintos

brintos / llvm-project-archived public Read only

0
0
Text · 852 B · 7331056 Raw
31 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -verify %s2 3template<typename ...T> struct X {4  void f(int);5  void f(...);6  static int n;7};8 9template<typename T, typename U> using A = T;10 11// These definitions are OK, X<A<T, decltype(...)>...> is equivalent to X<T...>12// so this defines the member of the primary template.13template<typename ...T>14void X<A<T, decltype(f(T()))>...>::f(int) {} // expected-error {{undeclared}}15 16template<typename ...T>17int X<A<T, decltype(f(T()))>...>::n = 0; // expected-error {{undeclared}}18 19struct Y {}; void f(Y);20 21void g() {22  // OK, substitution succeeds.23  X<Y>().f(0);24  X<Y>::n = 1;25 26  // Error, substitution fails; this should not be treated as a SFINAE-able27  // condition, so we don't select X<void>::f(...).28  X<void>().f(0); // expected-note {{instantiation of}}29  X<void>::n = 1; // expected-note {{instantiation of}}30}31