- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While answering this question I realized that ICC got it wrong about precedence of sizeof and []
#include <iostream>
int main() {
std::cout << (sizeof(int)["abcdefghij"]) << '\n';
}
It should be parsed as sizeof((int)["abcdefghij"]) because [] has higher precedence than sizeof which will result in a compilation error. But ICC 21.1.9 does compile it and prints "e" which is "abcdefghij"[sizeof(int)]
From the above link we can see that other compilers report an error as expected
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems to be a bug in icpc. icpx does give an error as expected. Will icpx work for you or you would like to see it fixed?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It isn't important to me since I don't use it for work. Just report it so you guys know that there's a bug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've reported this to our Developer and we will will no longer respond to this thread.
If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
Thanks,

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