- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp]static const int x = 10;
struct S {
int a = x;
};
int main() {
S s;
}[/cpp]
internal error: assertion failed at: "shared/cfe/edgcpfe/expr.c", line 39144
ICC 13 update 1 on windows.
And question: when about will be new release/beta of ICC?
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bert,
I got the following error with icc 13 update 1. Please let me know the compiler options you were using.
>icl -c test.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Ve
rsion 13.0.1.119 Build 20121008
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
icl: command line warning #10006: ignoring unknown option '/std=c99'
test.cpp
test.cpp(3): error: data member initializer is not allowed
int a = x;
^
compilation aborted for test.cpp (code 2)
>
Thanks,
Feilong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, man! Only /Qstd=c++0x because it's c++11 feature.
J:\>icl /Qstd=c++0x main.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version 13.0 Build 2
0121008
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
main.cpp
main.cpp(3): internal error: assertion failed at: "shared/cfe/edgcpfe/expr.c", l
ine 39144
struct S {
^
compilation aborted for main.cpp (code 4)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reporting this. I have entered this into our bug tracking system as DPD200239790.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've done a quick verification with MS C/C++ compiler and it fails to compile the test case:
...
...error C2864: 'S::a' : only static const integral data members can be initialized within a class
...
I think Intel C++ compiler shoul display a regular compilation error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And three more verifications with the test-case provided:
[ Borland C++ compiler ]
...
Error E2233 ../../Common/PrtTests.cpp 678: Cannot initialize a class member here
...
[ MinGW C++ compiler ]
...
../../Common/PrtTests.cpp:678: error: ISO C++ forbids initialization of member `a'
../../Common/PrtTests.cpp:678: error: making `a' static
../../Common/PrtTests.cpp:678: error: ISO C++ forbids in-class initialization of non-const static member `a'
...
[ Turbo C++ compiler ]
...
Error ../../Common/PrtTests.cpp 678: Cannot initialize a class member here
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The internal error issue has been resolved in 14.0 compiler. FYI.
Feilong

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