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

            Bug ID: 67960
           Summary: Prefixing a function with [[deprecated]] produces
                    multiple warnings
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chrisb2244 at gmail dot com
  Target Milestone: ---

The [[deprecated]] prefix for a function produces multiple warnings.

In v5.2.0, there are 3 warnings for the code

    [[deprecated]] void doNothing(){}
    int main(){
        doNothing();
    }

I am informed that in v4.9.2, only 2 warnings are emitted for the same code - 
http://stackoverflow.com/questions/33117030/when-using-deprecated-the-warning-is-given-3-times?noredirect=1#comment54048535_33117030

Replacing the body of main with

    auto f = doNothing;
    f();

reduces the output to 2 warnings in v5.2.0, and apparently 1 warning in 4.9.2


Bug 17729 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729) seems to be
about a similar issue (the same issue?) but there discusses the attribute
rather than a tag - I assume the tag is implemented in terms of the attribute
but am unsure hence a new bug report.

Reply via email to