Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Daniel_A_1
Beginner
132 Views

[Bug report] Spurious #2651 warning for deprecating a "using" alias.

Dear all,

trying to deprecate a "using" alias as in

 using foo [[deprecated]] = int;
 
 int main()
 {
   foo f = 1;
 };

gives me

test-deprecate.cc(1): warning #2651: attribute does not apply to any entity
  using foo [[deprecated]] = int;
              ^

test-deprecate.cc(5): warning #1478: type "foo" (declared at line 1) was declared deprecated
    foo f = 1;
        ^

using ICC16, ICC17, ICC18 and ICC19. The deprecation is correctly detected by warning #1478 so #2651 is spurious here.

Best,

Daniel

0 Kudos
7 Replies
Viet_H_Intel
Moderator
132 Views

Hi Daniel,

What are  your command line options?

Thanks,

Viet

Daniel_A_1
Beginner
132 Views

Hi Viet, I am just using "-std=c++14". I can also reproduce this using godbolt: https://godbolt.org/g/p7Y8Tz Best, Daniel
Viet_H_Intel
Moderator
132 Views

Does GNU compiler gives you a warning as well? 

Thanks,

Viet

Daniel_A_1
Beginner
132 Views

gcc generates the expected deprecation warning from version 4.9.0 on and clang from version 3.3 on.

Best,

Daniel

Viet_H_Intel
Moderator
132 Views

You can suppress it by -wd2651.

Thanks,

Viet

Daniel_A_1
Beginner
132 Views

Of course, I can suppress it with -wd2651. That was never the question. It should just not have appeared in the first place. This is why I labeled the topic "bug report".

Best,

Daniel

132 Views

So, has there been any progress or is the suppression still the only viable choice?

Reply