view clang/test/SemaCXX/attr-reinitializes.cpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children
line wrap: on
line source

// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s

[[clang::reinitializes]] int a; // expected-error {{'reinitializes' attribute only applies to non-static non-const member functions}}

[[clang::reinitializes]] void f(); // expected-error {{only applies to}}

struct A {
  [[clang::reinitializes]] void foo();
  __attribute__((reinitializes)) void gnu_foo();
  [[clang::reinitializes]] void bar() const; // expected-error {{only applies to}}
  [[clang::reinitializes]] static void baz(); // expected-error {{only applies to}}
  [[clang::reinitializes]] int a; // expected-error {{only applies to}}

  [[clang::reinitializes("arg")]] void qux(); // expected-error {{'reinitializes' attribute takes no arguments}}
};