f4a2713ac8
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
23 lines
829 B
C++
23 lines
829 B
C++
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
|
|
|
|
int i = delete; // expected-error{{only functions}}
|
|
int j = default; // expected-error{{special member functions}}
|
|
|
|
int f() = delete, g; // expected-error{{'= delete' is a function definition}}
|
|
int o, p() = delete; // expected-error{{'= delete' is a function definition}}
|
|
|
|
int q() = default, r; // expected-error{{only special member functions}} \
|
|
// expected-error{{'= default' is a function definition}}
|
|
int s, t() = default; // expected-error{{'= default' is a function definition}}
|
|
|
|
struct foo {
|
|
foo() = default;
|
|
~foo() = delete;
|
|
void bar() = delete;
|
|
};
|
|
|
|
void baz() = delete;
|
|
|
|
struct quux {
|
|
int quux() = default; // expected-error{{constructor cannot have a return type}} expected-error {{member 'quux' has the same name as its class}}
|
|
};
|