- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If I write a class with [[nodiscard]] attribute, with an operator= that returns *this by reference, I get a warning #3931: ignoring return value type with "nodiscard" attribute.
Since the nodiscard object is returned by reference and not by value, there should be no such warning.
Here is a reproducible example that produces this error on icc 18.0 to icc 2021.5 in https://godbolt.org/z/jqs41Ebrd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Louis,
Thanks for reaching out to us.
The issue raised by you is reproducible when trying with icc (latest 2021.5.0) from our end as well.
Could you please try compiling with icpx/icx (latest 2022.0) compiler instead?
It is working as expected without throwing any such warnings when we tried it from our end.
Also, Intel Classic Compiler will enter "Legacy Product Support" mode, signaling the end of regular updates. Please refer to the article below for more details.
Regards,
Vidya.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Louis,
Thanks for reaching out to us.
The issue raised by you is reproducible when trying with icc (latest 2021.5.0) from our end as well.
Could you please try compiling with icpx/icx (latest 2022.0) compiler instead?
It is working as expected without throwing any such warnings when we tried it from our end.
Also, Intel Classic Compiler will enter "Legacy Product Support" mode, signaling the end of regular updates. Please refer to the article below for more details.
Regards,
Vidya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Louis,
Reminder:
Has the information provided helped? Please let us know if you have any updates regarding the query.
Regards,
Vidya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vidya,
Indeed, everything is fine with icpx/icx 2022.0
Thanks for your answer.
Regards,
Louis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Louis,
Thanks for accepting our solution.
As the issue is resolved we are closing this thread. Please post a new question if you need any additional information from Intel as this thread will no longer be monitored.
Have a Nice Day!
Regards,
Vidya.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page