Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

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

Daniel_A_1
Beginner
791 Views

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
791 Views

Hi Daniel,

What are  your command line options?

Thanks,

Viet

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

Does GNU compiler gives you a warning as well? 

Thanks,

Viet

0 Kudos
Daniel_A_1
Beginner
791 Views

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

Best,

Daniel

0 Kudos
Viet_H_Intel
Moderator
791 Views

You can suppress it by -wd2651.

Thanks,

Viet

0 Kudos
Daniel_A_1
Beginner
791 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

0 Kudos
Miltenberger__Matthi
791 Views

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

0 Kudos
Reply