p7.cpp 447 B

123456789101112131415
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // A non-type template-parameter shall not be declared to have
  3. // floating point, class, or void type.
  4. struct A;
  5. template<double d> class X; // expected-error{{cannot have type}}
  6. template<double* pd> class Y; //OK
  7. template<double& rd> class Z; //OK
  8. template<A a> class X0; // expected-error{{cannot have type}}
  9. typedef void VOID;
  10. template<VOID a> class X01; // expected-error{{cannot have type}}