annotate clang/test/SemaCXX/attr-flatten.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 int i __attribute__((flatten)); // expected-error {{'flatten' attribute only applies to functions}}
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 void f1() __attribute__((flatten));
anatofuz
parents:
diff changeset
6 void f2() __attribute__((flatten(1))); // expected-error {{'flatten' attribute takes no arguments}}
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 template <typename T>
anatofuz
parents:
diff changeset
9 void tf1() __attribute__((flatten));
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 int f3(int __attribute__((flatten)), int); // expected-error{{'flatten' attribute only applies to functions}}
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 struct A {
anatofuz
parents:
diff changeset
14 int f __attribute__((flatten)); // expected-error{{'flatten' attribute only applies to functions}}
anatofuz
parents:
diff changeset
15 void mf1() __attribute__((flatten));
anatofuz
parents:
diff changeset
16 static void mf2() __attribute__((flatten));
anatofuz
parents:
diff changeset
17 };
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 int ci [[gnu::flatten]]; // expected-error {{'flatten' attribute only applies to functions}}
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 [[gnu::flatten]] void cf1();
anatofuz
parents:
diff changeset
22 [[gnu::flatten(1)]] void cf2(); // expected-error {{'flatten' attribute takes no arguments}}
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 template <typename T>
anatofuz
parents:
diff changeset
25 [[gnu::flatten]]
anatofuz
parents:
diff changeset
26 void ctf1();
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 int cf3(int c[[gnu::flatten]], int); // expected-error{{'flatten' attribute only applies to functions}}
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 struct CA {
anatofuz
parents:
diff changeset
31 int f [[gnu::flatten]]; // expected-error{{'flatten' attribute only applies to functions}}
anatofuz
parents:
diff changeset
32 [[gnu::flatten]] void mf1();
anatofuz
parents:
diff changeset
33 [[gnu::flatten]] static void mf2();
anatofuz
parents:
diff changeset
34 };