Martin Bohme | 4e1293b | 2018-08-13 14:11:03 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s |
| 2 | |
| 3 | [[clang::reinitializes]] int a; // expected-error {{'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 {{'reinitializes' attribute takes no arguments}} |
| 15 | }; |