brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 4eb8edc Raw
24 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s2 3template<class> class Foo {4  template<class UBar // expected-error {{expected ';' after class}}5                      // expected-note@-1 {{'UBar' declared here}}6                      // expected-note@-2 {{forward declaration of 'UBar'}}7  void foo1(); // expected-error {{non-type template parameter has incomplete type 'class UBar'}}8               // expected-error@-1 {{expected ',' or '>' in template-parameter-list}}9               // expected-error@-2 {{declaration does not declare anything}}10};11 12Foo<int>::UBar g1; // expected-error {{no type named 'UBar' in 'Foo<int>'}}13 14class C0 {15public:16  template<typename T0, typename T1 = T0 // missing closing angle bracket17  struct S0 {}; // expected-error {{'S0' cannot be defined in a type specifier}}18                // expected-error@-1 {{expected ',' or '>' in template-parameter-list}}19                // expected-error@-2 {{declaration does not declare anything}}20  C0() : m(new S0<int>) {} // expected-error {{expected '(' for function-style cast or type construction}}21                           // expected-error@-1 {{expected expression}}22  S0<int> *m; // expected-error {{expected member name or ';' after declaration specifiers}}23};24