2020-05-22 07:44:30 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fsyntax-only %s
|
|
|
|
|
|
|
|
void bar();
|
|
|
|
|
|
|
|
void foo() {
|
|
|
|
[[clang::nomerge]] bar();
|
|
|
|
[[clang::nomerge(1, 2)]] bar(); // expected-error {{'nomerge' attribute takes no arguments}}
|
|
|
|
int x;
|
|
|
|
[[clang::nomerge]] x = 10; // expected-warning {{nomerge attribute is ignored because there exists no call expression inside the statement}}
|
|
|
|
|
2020-12-08 08:37:14 +08:00
|
|
|
[[clang::nomerge]] label: bar(); // expected-error {{'nomerge' attribute only applies to functions and statements}}
|
2020-05-22 07:44:30 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-08 08:37:14 +08:00
|
|
|
[[clang::nomerge]] int f();
|
2020-05-22 07:44:30 +08:00
|
|
|
|
2020-12-08 08:37:14 +08:00
|
|
|
[[clang::nomerge]] static int i = f(); // expected-error {{'nomerge' attribute only applies to functions and statements}}
|