Home | History | Annotate | Download | only in SemaCXX
      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 
     11 int N::f() { // Ok
     12   return Y; // Ok
     13 }
     14 
     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 
     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