1 // PR c++/79817 - attribute deprecated on namespace. 2 // { dg-do compile { target c++11 } } 3 4 namespace [[deprecated]] { // { dg-warning "ignoring .deprecated. attribute on anonymous namespace" } 5 int nn; 6 } 7 8 inline namespace [[deprecated]] I { 9 int x; 10 } 11 12 namespace M { 13 int y; 14 inline namespace [[deprecated]] N { 15 int x; 16 } 17 } 18 19 void g()20g () 21 { 22 nn = 42; 23 I::x = 42; // { dg-warning ".I. is deprecated" } 24 M::x = 42; 25 M::y = 42; 26 M::N::x = 42; // { dg-warning ".M::N. is deprecated" } 27 } 28