p9.cpp 638 B

12345678910111213141516171819
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // expected-no-diagnostics
  3. // Template type parameters.
  4. typedef unsigned char T;
  5. template<typename T = T> struct X0 { };
  6. template<> struct X0<unsigned char> { static const bool value = true; };
  7. int array0[X0<>::value? 1 : -1];
  8. // Non-type template parameters.
  9. const int N = 17;
  10. template<int N = N> struct X1 { };
  11. template<> struct X1<17> { static const bool value = true; };
  12. int array1[X1<>::value? 1 : -1];
  13. // Template template parameters.
  14. template<template<class> class X0 = X0> struct X2 { };
  15. template<> struct X2<X0> { static const bool value = true; };
  16. int array2[X2<>::value? 1 : -1];