brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 686873d Raw
53 lines · cpp
1// RUN: %clang_cc1 %s -verify2 3namespace N1 {4template <typename... Ts>5struct Foo {6  template <typename T>7  struct Bar {8    static constexpr bool is_present = false;9  };10};11 12template <typename T, typename... Ts>13struct Foo<T, Ts...> : public Foo<Ts...> {14  using template Foo<Ts...>::Bar;15  // expected-error@-1 {{'template' keyword not permitted after 'using' keyword}}16};17}18 19namespace N2 {20namespace foo {21  using I = int;22}23using template namespace foo;24// expected-error@-1 {{'template' keyword not permitted after 'using' keyword}}25using template template namespace foo;26// expected-error@-1 2{{'template' keyword not permitted after 'using' keyword}}27I i;28}29 30namespace N3 {31namespace foo {32  using I = int;33}34using template foo::I;35// expected-error@-1 {{'template' keyword not permitted after 'using' keyword}}36I i;37}38 39namespace N4 {40template <typename T>41class A {};42 43template <typename T>44using B = A<T>;45B<int> b;46 47using template <typename T> C = A<T>;48// expected-error@-1 {{'template' keyword not permitted after 'using' keyword}}49// expected-error@-2 {{expected unqualified-id}}50C<int> c;51// expected-error@-1 {{no template named 'C'}}52}53