Debian Codegraph @

gcc/testsuite/gdc.test/compilable/dtoh_invalid_identifiers.d

raw
1 /+
2 REQUIRED_ARGS: -verrors=simple -HC -c -o- -wi -extern-std=c++20
3 PERMUTE_ARGS:
4 TEST_OUTPUT:
5 ---
6 compilable/dtoh_invalid_identifiers.d(103): Warning: function `register` is a keyword in C++
7 compilable/dtoh_invalid_identifiers.d(103): The generated C++ header will contain identifiers that are keywords in C++
8 compilable/dtoh_invalid_identifiers.d(105): Warning: namespace `const_cast` is a keyword in C++
9 compilable/dtoh_invalid_identifiers.d(116): Warning: function `and` is a special operator in C++
10 compilable/dtoh_invalid_identifiers.d(121): Warning: enum `mutable` is a keyword in C++
11 compilable/dtoh_invalid_identifiers.d(123): Warning: alias `char8_t` is a keyword in C++20
12 compilable/dtoh_invalid_identifiers.d(141): Warning: function `offsetof` is a default macro in C++
13 compilable/dtoh_invalid_identifiers.d(143): Warning: function `wchar_t` is a keyword in C++11
14 compilable/dtoh_invalid_identifiers.d(145): Warning: function `__attribute__` is a reserved identifier in C++
15 // Automatically generated by Digital Mars D Compiler
16
17 #pragma once
18
19 #include <assert.h>
20 #include <math.h>
21 #include <stddef.h>
22 #include <stdint.h>
23
24 extern void register(int32_t* ptr);
25
26 namespace const_cast
27 {
28 extern void bar();
29
30 }
31 template <typename register_>
32 struct S final
33 {
34 register_ x;
35 S()
36 {
37 }
38 };
39
40 struct S2 final
41 {
42 int32_t register_;
43 void and();
44 S2() :
45 register_()
46 {
47 }
48 S2(int32_t register_) :
49 register_(register_)
50 {}
51 };
52
53 extern void f(int32_t alignas_);
54
55 enum class mutable
56 {
57 yes = 0,
58 no = 1,
59 };
60
61 typedef S<char > char8_t;
62
63 class Base
64 {
65 public:
66 virtual void foo();
67 };
68
69 template <typename typename_>
70 class Alias : public typename_
71 {
72 };
73
74 extern void user(Alias<Base* >* i);
75
76 template <typename typename_>
77 struct InvalidNames final
78 {
79 typename_ register_;
80 void foo(typename_ and_);
81 InvalidNames()
82 {
83 }
84 };
85
86 extern void useInvalid(InvalidNames<int32_t > __param_0_);
87
88 extern size_t offsetof();
89
90 extern void wchar_t();
91
92 extern void __attribute__();
93 ---
94 +/
95 #line 100
96 extern(C++):
97
98 __gshared bool and;
99 void register(int* ptr) {}
100
101 extern(C++, const_cast)
102 void bar() {}
103
104 struct S(register)
105 {
106 register x;
107 }
108
109 struct S2
110 {
111 int register;
112 void and() {}
113 }
114
115 void f(int alignas) {}
116
117 enum mutable { yes, no }
118
119 alias char8_t = S!char;
120
121 class Base {
122 void foo() {}
123 }
124 class Alias(typename) : typename {}
125
126 void user(Alias!Base i) {}
127
128 struct InvalidNames(typename)
129 {
130 typename register;
131
132 void foo(typename and) {}
133 }
134
135 void useInvalid(InvalidNames!int) {}
136
137 size_t offsetof() { return 0; }
138
139 void wchar_t() {}
140
141 void __attribute__() {}