p4.cpp 667 B

123456789101112131415161718192021
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. class X;
  3. // C++ [temp.param]p4
  4. typedef int INT;
  5. enum E { enum1, enum2 };
  6. template<int N> struct A1;
  7. template<INT N, INT M> struct A2;
  8. template<enum E x, E y> struct A3;
  9. template<int &X> struct A4;
  10. template<int *Ptr> struct A5;
  11. template<int (&f)(int, int)> struct A6;
  12. template<int (*fp)(float, double)> struct A7;
  13. template<int X::*pm> struct A8;
  14. template<float (X::*pmf)(float, int)> struct A9;
  15. template<typename T, T x> struct A10;
  16. template<float f> struct A11; // expected-error{{a non-type template parameter cannot have type 'float'}}
  17. template<void *Ptr> struct A12;
  18. template<int (*IncompleteArrayPtr)[]> struct A13;