[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Parser / cxx11-type-specifier.cpp
blob1676623ef65b87dbdca03b248373e08d5f30893a
1 // RUN: %clang_cc1 -verify %s -std=c++11 -fcxx-exceptions
3 // Tests for parsing of type-specifier-seq
5 struct S {
6 operator constexpr int(); // expected-error{{type name does not allow constexpr}}
7 };
8 enum E { e };
10 void f() {
11 try {
12 (void) new constexpr int; // expected-error{{type name does not allow constexpr}}
13 } catch (constexpr int) { // expected-error{{type name does not allow constexpr}}
16 // These parse as type definitions, not as type references with braced
17 // initializers. Sad but true...
18 (void) new struct S {}; // expected-error{{'S' cannot be defined in a type specifier}}
19 (void) new enum E { e }; // expected-error{{'E' cannot be defined in a type specifier}}
22 // And for trailing-type-specifier-seq
24 auto f() -> unknown; // expected-error{{unknown type name 'unknown'}}