blob: 129d359b8b7424d1dd05593e0ee2e1fcbeb7bea1 [file] [log] [blame]
Martin Bohme4e1293b2018-08-13 14:11:03 +00001// 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
7struct 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};