YouCompleteMe/cpp/llvm/tools/clang/test/Parser/cxx-default-delete.cpp
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

24 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}}
};