File: has_attribute.cpp

package info (click to toggle)
llvm-toolchain-3.8 1%3A3.8.1-24
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 379,280 kB
  • ctags: 388,501
  • sloc: cpp: 2,309,705; ansic: 477,070; objc: 100,918; asm: 97,974; python: 95,911; sh: 18,634; makefile: 7,294; perl: 5,584; ml: 5,460; pascal: 4,661; lisp: 2,548; xml: 686; cs: 350; php: 212; csh: 117
file content (68 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// RUN: %clang_cc1 -triple i386-unknown-unknown -fms-compatibility -std=c++11 -E %s -o - | FileCheck %s

// CHECK: has_cxx11_carries_dep
#if __has_cpp_attribute(carries_dependency)
  int has_cxx11_carries_dep();
#endif

// CHECK: has_clang_fallthrough_1
#if __has_cpp_attribute(clang::fallthrough)
  int has_clang_fallthrough_1();
#endif

// CHECK: does_not_have_selectany
#if !__has_cpp_attribute(selectany)
  int does_not_have_selectany();
#endif

// The attribute name can be bracketed with double underscores.
// CHECK: has_clang_fallthrough_2
#if __has_cpp_attribute(clang::__fallthrough__)
  int has_clang_fallthrough_2();
#endif

// The scope cannot be bracketed with double underscores.
// CHECK: does_not_have___clang___fallthrough
#if !__has_cpp_attribute(__clang__::fallthrough)
  int does_not_have___clang___fallthrough();
#endif

// Test that C++11, target-specific attributes behave properly.

// CHECK: does_not_have_mips16
#if !__has_cpp_attribute(gnu::mips16)
  int does_not_have_mips16();
#endif

// Test that the version numbers of attributes listed in SD-6 are supported
// correctly.

// CHECK: has_cxx11_carries_dep_vers
#if __has_cpp_attribute(carries_dependency) == 200809
  int has_cxx11_carries_dep_vers();
#endif

// CHECK: has_cxx11_noreturn_vers
#if __has_cpp_attribute(noreturn) == 200809
  int has_cxx11_noreturn_vers();
#endif

// CHECK: has_cxx14_deprecated_vers
#if __has_cpp_attribute(deprecated) == 201309
  int has_cxx14_deprecated_vers();
#endif

// CHECK: has_declspec_uuid
#if __has_declspec_attribute(uuid)
  int has_declspec_uuid();
#endif

// CHECK: has_declspec_uuid2
#if __has_declspec_attribute(__uuid__)
  int has_declspec_uuid2();
#endif

// CHECK: does_not_have_declspec_fallthrough
#if !__has_declspec_attribute(fallthrough)
  int does_not_have_declspec_fallthrough();
#endif