Akira Hatanaka | 12ddcee | 2017-06-26 18:46:12 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s |
| 2 | |
| 3 | template<class> class Foo { |
| 4 | template<class UBar // expected-error {{expected ';' after class}} |
| 5 | // expected-note@-1 {{'UBar' declared here}} |
| 6 | void foo1(); // expected-error {{a non-type template parameter cannot have type 'class UBar'}} |
| 7 | // expected-error@-1 {{expected ',' or '>' in template-parameter-list}} |
| 8 | // expected-warning@-2 {{declaration does not declare anything}} |
| 9 | }; |
| 10 | |
| 11 | Foo<int>::UBar g1; // expected-error {{no type named 'UBar' in 'Foo<int>'}} |
| 12 | |
| 13 | class C0 { |
| 14 | public: |
| 15 | template<typename T0, typename T1 = T0 // missing closing angle bracket |
| 16 | struct S0 {}; // expected-error {{'S0' cannot be defined in a type specifier}} |
| 17 | // expected-error@-1 {{cannot combine with previous 'type-name' declaration specifier}} |
| 18 | // expected-error@-2 {{expected ',' or '>' in template-parameter-list}} |
| 19 | // expected-warning@-3 {{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 | }; |