annotate clang/test/SemaTemplate/ext_ms_template_spec.cpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +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 -fms-extensions -std=c++11 -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 namespace A {
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 template <class T>
anatofuz
parents:
diff changeset
6 class ClassTemplate; // expected-note {{explicitly specialized declaration is here}}
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 template <class T1, class T2>
anatofuz
parents:
diff changeset
9 class ClassTemplatePartial; // expected-note {{explicitly specialized declaration is here}}
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 template <typename T> struct X {
anatofuz
parents:
diff changeset
12 struct MemberClass; // expected-note {{explicitly specialized declaration is here}}
anatofuz
parents:
diff changeset
13 enum MemberEnumeration; // expected-note {{explicitly specialized declaration is here}} // expected-error {{ISO C++ forbids forward references to 'enum' types}}
anatofuz
parents:
diff changeset
14 };
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 }
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 namespace B {
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 template <>
anatofuz
parents:
diff changeset
21 class A::ClassTemplate<int>; // expected-warning {{class template specialization of 'ClassTemplate' not in a namespace enclosing 'A' is a Microsoft extension}}
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 template <class T1>
anatofuz
parents:
diff changeset
24 class A::ClassTemplatePartial<T1, T1 *> {}; // expected-warning {{class template partial specialization of 'ClassTemplatePartial' not in a namespace enclosing 'A' is a Microsoft extension}}
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 template <>
anatofuz
parents:
diff changeset
27 struct A::X<int>::MemberClass; // expected-warning {{member class specialization of 'MemberClass' not in class 'X' or an enclosing namespace is a Microsoft extension}}
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 template <>
anatofuz
parents:
diff changeset
30 enum A::X<int>::MemberEnumeration; // expected-warning {{member enumeration specialization of 'MemberEnumeration' not in class 'X' or an enclosing namespace is a Microsoft extension}} // expected-error {{ISO C++ forbids forward references to 'enum' types}}
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33