brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · cb30321 Raw
34 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -fms-extensions -std=c++11 -verify %s2 3namespace A {4 5template <class T>6class ClassTemplate; // expected-note {{explicitly specialized declaration is here}}7 8template <class T1, class T2>9class ClassTemplatePartial; // expected-note {{explicitly specialized declaration is here}}10 11template <typename T> struct X {12  struct MemberClass; // expected-note {{explicitly specialized declaration is here}}13  enum MemberEnumeration; // expected-note {{explicitly specialized declaration is here}} // expected-error {{ISO C++ forbids forward references to 'enum' types}}14};15 16}17 18namespace B {19 20template <>21class A::ClassTemplate<int>; // expected-warning {{class template specialization of 'ClassTemplate' not in a namespace enclosing 'A' is a Microsoft extension}}22 23template <class T1>24class A::ClassTemplatePartial<T1, T1 *> {}; // expected-warning {{class template partial specialization of 'ClassTemplatePartial' not in a namespace enclosing 'A' is a Microsoft extension}}25 26template <>27struct A::X<int>::MemberClass; // expected-warning {{member class specialization of 'MemberClass' not in class 'X' or an enclosing namespace is a Microsoft extension}}28 29template <>30enum 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}}31 32}33 34