@@ -133,8 +133,8 @@ void test_NE() {
133
133
// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{110:9-110:9}:"("
134
134
// CHECK: fix-it:"{{.*}}macro_with_initializer_list.cpp":{110:32-110:32}:")"
135
135
136
- #define INIT (var, init ) Foo var = init; // expected-note 3{{defined here}}
137
- // expected-note@-1 2{{'INIT' exists, but as a function-like macro; perhaps, did you forget the parentheses? }}
136
+ #define INIT (var, init ) Foo var = init; // expected-note 3{{macro 'INIT' defined here}}
137
+ // expected-note@-1 2{{'INIT' is defined here as a function-like macro; did you mean to write 'INIT(...)' }}
138
138
// Can't use an initializer list as a macro argument. The commas in the list
139
139
// will be interpretted as argument separaters and adding parenthesis will
140
140
// make it no longer an initializer list.
@@ -166,7 +166,7 @@ void test() {
166
166
#define M (name,a,b,c,d,e,f,g,h,i,j,k,l ) \
167
167
Foo name = a + b + c + d + e + f + g + h + i + j + k + l;
168
168
// expected-note@-2 2{{defined here}}
169
- // expected-note@-3 {{'M' exists, but as a function-like macro; perhaps, did you forget the parentheses? }}
169
+ // expected-note@-3 {{'M' is defined here as a function-like macro; did you mean to write 'M(...)' }}
170
170
void test2 () {
171
171
M (F1, Foo (), Foo (), Foo (), Foo (), Foo (), Foo (),
172
172
Foo (), Foo (), Foo (), Foo (), Foo (), Foo ());
@@ -182,3 +182,11 @@ void test2() {
182
182
// expected-error@-3 {{use of undeclared identifier}}
183
183
// expected-note@-4 {{cannot use initializer list at the beginning of a macro argument}}
184
184
}
185
+
186
+ #define LIM () 10
187
+ // expected-note@-1 {{'LIM' is defined here as a function-like macro; did you mean to write 'LIM(...)'}}
188
+
189
+ void test3 () {
190
+ int iter = LIM;
191
+ // expected-error@-1 {{use of undeclared identifier LIM}}
192
+ }
0 commit comments