@@ -222,6 +222,53 @@ namespace cwg1815 { // cwg1815: no
222
222
#endif
223
223
}
224
224
225
+ namespace cwg1820 { // cwg1820: 3.5
226
+ typedef int A;
227
+ typedef int cwg1820::A;
228
+ // expected-warning@-1 {{extra qualification on member 'A'}}
229
+ // expected-error@-2 {{typedef declarator cannot be qualified}}
230
+
231
+ namespace B {
232
+ typedef int cwg1820::A;
233
+ // expected-error@-1 {{cannot define or redeclare 'A' here because namespace 'B' does not enclose namespace 'cwg1820'}}
234
+ // expected-error@-2 {{typedef declarator cannot be qualified}}
235
+ }
236
+
237
+ class C1 {
238
+ typedef int cwg1820::A;
239
+ // expected-error@-1 {{non-friend class member 'A' cannot have a qualified name}}
240
+ // expected-error@-2 {{typedef declarator cannot be qualified}}
241
+ };
242
+
243
+ template <typename >
244
+ class C2 {
245
+ typedef int cwg1820::A;
246
+ // expected-error@-1 {{non-friend class member 'A' cannot have a qualified name}}
247
+ // expected-error@-2 {{typedef declarator cannot be qualified}}
248
+ };
249
+
250
+ void d1 () {
251
+ typedef int cwg1820::A;
252
+ // expected-error@-1 {{definition or redeclaration of 'A' not allowed inside a function}}
253
+ // expected-error@-2 {{typedef declarator cannot be qualified}}
254
+ }
255
+
256
+ template <typename >
257
+ void d2 () {
258
+ typedef int cwg1820::A;
259
+ // expected-error@-1 {{definition or redeclaration of 'A' not allowed inside a function}}
260
+ // expected-error@-2 {{typedef declarator cannot be qualified}}
261
+ }
262
+
263
+ #if __cplusplus >= 201103L
264
+ auto e = [] {
265
+ typedef int cwg1820::A;
266
+ // expected-error@-1 {{definition or redeclaration of 'A' not allowed inside a function}}
267
+ // expected-error@-2 {{typedef declarator cannot be qualified}}
268
+ };
269
+ #endif
270
+ } // namespace cwg1820
271
+
225
272
namespace cwg1821 { // cwg1821: 2.9
226
273
struct A {
227
274
template <typename > struct B {
0 commit comments