mirror of
https://github.com/opnsense/src.git
synced 2026-03-12 05:32:15 -04:00
20 lines
701 B
C++
20 lines
701 B
C++
// RUN: %clang_cc1 -verify %s -std=c++11 -fcxx-exceptions
|
|
|
|
// Tests for parsing of type-specifier-seq
|
|
|
|
struct S {
|
|
operator constexpr int(); // expected-error{{type name does not allow constexpr}}
|
|
};
|
|
enum E { e };
|
|
|
|
void f() {
|
|
try {
|
|
(void) new constexpr int; // expected-error{{type name does not allow constexpr}}
|
|
} catch (constexpr int) { // expected-error{{type name does not allow constexpr}}
|
|
}
|
|
|
|
// These parse as type definitions, not as type references with braced
|
|
// initializers. Sad but true...
|
|
(void) new struct S {}; // expected-error{{'S' can not be defined in a type specifier}}
|
|
(void) new enum E { e }; // expected-error{{'E' can not be defined in a type specifier}}
|
|
}
|