@@ -183,6 +183,39 @@ namespace dr2358 { // dr2358: 16
183
183
}
184
184
#endif
185
185
186
+ // CWG2363 was closed as NAD, but its resolution does affirm that
187
+ // a friend declaration cannot have an opaque-enumm-specifier.
188
+ namespace dr2363 { // dr2363: yes
189
+
190
+ enum class E0 ;
191
+ enum E1 : int ;
192
+
193
+ struct A {
194
+ friend enum class E0 ;
195
+ // since-cxx11-error@-1 {{reference to enumeration must use 'enum' not 'enum class'}}
196
+ // expected-error@-2 {{elaborated enum specifier cannot be declared as a friend}}
197
+ // expected-note@-3 {{remove 'enum class' to befriend an enum}}
198
+
199
+ friend enum E0 ;
200
+ // expected-error@-1 {{elaborated enum specifier cannot be declared as a friend}}
201
+ // expected-note@-2 {{remove 'enum' to befriend an enum}}
202
+
203
+ friend enum class E1 ;
204
+ // since-cxx11-error@-1 {{reference to enumeration must use 'enum' not 'enum class'}}
205
+ // expected-error@-2 {{elaborated enum specifier cannot be declared as a friend}}
206
+ // expected-note@-3 {{remove 'enum class' to befriend an enum}}
207
+
208
+ friend enum E1 ;
209
+ // expected-error@-1 {{elaborated enum specifier cannot be declared as a friend}}
210
+ // expected-note@-2 {{remove 'enum' to befriend an enum}}
211
+
212
+ friend enum class E2 ;
213
+ // since-cxx11-error@-1 {{reference to enumeration must use 'enum' not 'enum class'}}
214
+ // expected-error@-2 {{elaborated enum specifier cannot be declared as a friend}}
215
+ // expected-note@-3 {{remove 'enum class' to befriend an enum}}
216
+ };
217
+ } // namespace dr2363
218
+
186
219
namespace dr2370 { // dr2370: no
187
220
namespace N {
188
221
typedef int type;
@@ -278,37 +311,4 @@ namespace dr2397 { // dr2397: 17
278
311
}
279
312
} // namespace dr2397
280
313
281
- // CWG2363 was closed as NAD, but its resolution does affirm that
282
- // a friend declaration cannot have an opaque-enumm-specifier.
283
- namespace dr2363 { // dr2363: yes
284
-
285
- enum class E0 ;
286
- enum E1 : int ;
287
-
288
- struct A {
289
- friend enum class E0 ;
290
- // since-cxx11-error@-1 {{reference to enumeration must use 'enum' not 'enum class'}}
291
- // expected-error@-2 {{elaborated enum specifier cannot be declared as a friend}}
292
- // expected-note@-3 {{remove 'enum class' to befriend an enum}}
293
-
294
- friend enum E0 ;
295
- // expected-error@-1 {{elaborated enum specifier cannot be declared as a friend}}
296
- // expected-note@-2 {{remove 'enum' to befriend an enum}}
297
-
298
- friend enum class E1 ;
299
- // since-cxx11-error@-1 {{reference to enumeration must use 'enum' not 'enum class'}}
300
- // expected-error@-2 {{elaborated enum specifier cannot be declared as a friend}}
301
- // expected-note@-3 {{remove 'enum class' to befriend an enum}}
302
-
303
- friend enum E1 ;
304
- // expected-error@-1 {{elaborated enum specifier cannot be declared as a friend}}
305
- // expected-note@-2 {{remove 'enum' to befriend an enum}}
306
-
307
- friend enum class E2 ;
308
- // since-cxx11-error@-1 {{reference to enumeration must use 'enum' not 'enum class'}}
309
- // expected-error@-2 {{elaborated enum specifier cannot be declared as a friend}}
310
- // expected-note@-3 {{remove 'enum class' to befriend an enum}}
311
- };
312
- } // namespace dr2363
313
-
314
314
#endif
0 commit comments