[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / attr-nomerge.cpp
blob294abfafcd2aa59045fadba30afb5ebba91d68d5
1 // RUN: %clang_cc1 -verify -fsyntax-only %s
3 void bar();
5 void foo() {
6 [[clang::nomerge]] bar();
7 [[clang::nomerge(1, 2)]] bar(); // expected-error {{'nomerge' attribute takes no arguments}}
8 int x;
9 [[clang::nomerge]] x = 10; // expected-warning {{'nomerge' attribute is ignored because there exists no call expression inside the statement}}
11 [[clang::nomerge]] label: bar(); // expected-error {{'nomerge' attribute only applies to functions and statements}}
15 [[clang::nomerge]] int f();
17 [[clang::nomerge]] static int i = f(); // expected-error {{'nomerge' attribute only applies to functions and statements}}