brintos

brintos / llvm-project-archived public Read only

0
0
Text · 633 B · af0a277 Raw
40 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// expected-no-diagnostics3 4extern int array[1];5 6template <typename>7class C {8  enum { D };9public:10  template <typename A> void foo1() {11    extern int array[((int)C<A>::k > (int)D) ? 1 : -1];12  }13};14 15template<>16class C<int> {17public:18  const static int k = 2;19};20 21void foo2() {22  C<char> c;23  c.foo1<int>();24}25 26template<int n>27void foo3() {28  extern int array[n ? 1 : -1];29}30 31void foo4() {32  foo3<5>();33}34 35namespace NS {36  int f() { extern int arr[3]; { extern int arr[]; } return 0; }37  template<typename T> void g() { extern int arr[3]; extern T arr; }38  template void g<int[]>();39}40