annotate clang/test/SemaTemplate/qualified-id.cpp @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // PR5061
anatofuz
parents:
diff changeset
4 namespace a {
anatofuz
parents:
diff changeset
5 template <typename T> class C {};
anatofuz
parents:
diff changeset
6 }
anatofuz
parents:
diff changeset
7 namespace b {
anatofuz
parents:
diff changeset
8 template<typename T> void f0(a::C<T> &a0) { }
anatofuz
parents:
diff changeset
9 }
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 namespace test1 {
anatofuz
parents:
diff changeset
13 int a = 0;
anatofuz
parents:
diff changeset
14 template <class T> class Base { };
anatofuz
parents:
diff changeset
15 template <class T> class Derived : public Base<T> {
anatofuz
parents:
diff changeset
16 int foo() {
anatofuz
parents:
diff changeset
17 return test1::a;
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19 };
anatofuz
parents:
diff changeset
20 }
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 namespace test2 {
anatofuz
parents:
diff changeset
23 class Impl {
anatofuz
parents:
diff changeset
24 public:
anatofuz
parents:
diff changeset
25 int foo();
anatofuz
parents:
diff changeset
26 };
anatofuz
parents:
diff changeset
27 template <class T> class Magic : public Impl {
anatofuz
parents:
diff changeset
28 int foo() {
anatofuz
parents:
diff changeset
29 return Impl::foo();
anatofuz
parents:
diff changeset
30 }
anatofuz
parents:
diff changeset
31 };
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 namespace PR6063 {
anatofuz
parents:
diff changeset
35 template <typename T> void f(T, T);
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 namespace detail
anatofuz
parents:
diff changeset
38 {
anatofuz
parents:
diff changeset
39 using PR6063::f;
anatofuz
parents:
diff changeset
40 }
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 template <typename T>
anatofuz
parents:
diff changeset
43 void g(T a, T b)
anatofuz
parents:
diff changeset
44 {
anatofuz
parents:
diff changeset
45 detail::f(a, b);
anatofuz
parents:
diff changeset
46 }
anatofuz
parents:
diff changeset
47 }
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 namespace PR12291 {
anatofuz
parents:
diff changeset
50 template <typename T>
anatofuz
parents:
diff changeset
51 class Outer2 {
anatofuz
parents:
diff changeset
52 template <typename V>
anatofuz
parents:
diff changeset
53 template <typename W>
anatofuz
parents:
diff changeset
54 class Outer2<V>::Inner; // expected-error{{nested name specifier 'Outer2<V>::' for declaration does not refer into a class, class template or class template partial specialization}}
anatofuz
parents:
diff changeset
55 };
anatofuz
parents:
diff changeset
56 }