1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++1z %s
2 
3 namespace [[deprecated]] {}  // expected-warning {{'deprecated' attribute on anonymous namespace ignored}}
4 
5 namespace [[deprecated]] N { // expected-note 4{{'N' has been explicitly marked deprecated here}}
6   int X;
7   int Y = X; // Ok
8   int f();
9 }
10 
f()11 int N::f() { // Ok
12   return Y; // Ok
13 }
14 
f()15 void f() {
16   int Y = N::f(); // expected-warning {{'N' is deprecated}}
17   using N::X; // expected-warning {{'N' is deprecated}}
18   int Z = X; //Ok
19 }
20 
g()21 void g() {
22   using namespace N; // expected-warning {{'N' is deprecated}}
23   int Z = Y; // Ok
24 }
25 
26 namespace M = N; // expected-warning {{'N' is deprecated}}
27 
28 // Shouldn't diag:
29 [[nodiscard, deprecated("")]] int PR37935();
30