comparison clang/test/Parser/using-template.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children
comparison
equal deleted inserted replaced
147:c2174574ed3a 150:1d019706d866
1 // RUN: %clang_cc1 %s -verify
2
3 namespace N1 {
4 template <typename... Ts>
5 struct Foo {
6 template <typename T>
7 struct Bar {
8 static constexpr bool is_present = false;
9 };
10 };
11
12 template <typename T, typename... Ts>
13 struct 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
19 namespace N2 {
20 namespace foo {
21 using I = int;
22 }
23 using template namespace foo;
24 // expected-error@-1 {{'template' keyword not permitted after 'using' keyword}}
25 using template template namespace foo;
26 // expected-error@-1 2{{'template' keyword not permitted after 'using' keyword}}
27 I i;
28 }
29
30 namespace N3 {
31 namespace foo {
32 using I = int;
33 }
34 using template foo::I;
35 // expected-error@-1 {{'template' keyword not permitted after 'using' keyword}}
36 I i;
37 }
38
39 namespace N4 {
40 template <typename T>
41 class A {};
42
43 template <typename T>
44 using B = A<T>;
45 B<int> b;
46
47 using template <typename T> C = A<T>;
48 // expected-error@-1 {{'template' keyword not permitted after 'using' keyword}}
49 // expected-error@-2 {{expected unqualified-id}}
50 C<int> c;
51 // expected-error@-1 {{no template named 'C'}}
52 }