p2.cpp 840 B

1234567891011121314151617181920212223
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // expected-no-diagnostics
  3. // There is no semantic difference between class and typename in a
  4. // template-parameter. typename followed by an unqualified-id names a
  5. // template type parameter.
  6. template<class T> struct X;
  7. template<typename T> struct X;
  8. // typename followed by aqualified-id denotes the type in a non-type
  9. // parameter-declaration.
  10. template<typename T, typename T::type Value> struct Y0;
  11. template<typename T, typename X<T>::type Value> struct Y1;
  12. // A storage class shall not be specified in a template-parameter declaration.
  13. template<static int Value> struct Z; // FIXME: expect an error
  14. // Make sure that we properly disambiguate non-type template parameters that
  15. // start with 'class'.
  16. class X1 { };
  17. template<class X1 *xptr> struct Y2 { };
  18. // FIXME: add the example from p2