| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s |
| 2 |
|
| 3 |
[[clang::reinitializes]] int a; // expected-error {{'clang::reinitializes' attribute only applies to non-static non-const member functions}} |
| 4 |
|
| 5 |
[[clang::reinitializes]] void f(); // expected-error {{only applies to}} |
| 6 |
|
| 7 |
struct A { |
| 8 |
[[clang::reinitializes]] void foo(); |
| 9 |
__attribute__((reinitializes)) void gnu_foo(); |
| 10 |
[[clang::reinitializes]] void bar() const; // expected-error {{only applies to}} |
| 11 |
[[clang::reinitializes]] static void baz(); // expected-error {{only applies to}} |
| 12 |
[[clang::reinitializes]] int a; // expected-error {{only applies to}} |
| 13 |
|
| 14 |
[[clang::reinitializes("arg")]] void qux(); // expected-error {{'clang::reinitializes' attribute takes no arguments}} |
| 15 |
}; |