https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79817

            Bug ID: 79817
           Summary: GCC does not recognize [[deprecated]] attribute for
                    namespace
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: boostcpp at gmail dot com
  Target Milestone: ---

GCC does not recognize [[deprecated]] attribute for namespace

http://melpon.org/wandbox/permlink/LVpUyDhcI75rNozy

namespace [[deprecated]] ns { int i ; }

int main()
{
    ns::i = 0;
}

Above code produce following warning message.

prog.cc:1:29: warning: 'deprecated' attribute directive ignored [-Wattributes]
 namespace [[deprecated]] ns { int i ; }
                             ^


Expect this messages.

prog.cc: In function 'int main()':
prog.cc:5:9: warning: 'ns' is deprecated [-Wdeprecated-declarations]
     ns::i = 0;
     ^
prog.cc:1:49: note: declared here
 namespace [[deprecated]] ns { int i ; }
                          ^

Reply via email to