Bug 50726 - [C++0x] ICE when specializing template with an Enum Class
Summary: [C++0x] ICE when specializing template with an Enum Class
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-14 10:03 UTC by coyotte508
Modified: 2011-10-14 10:13 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work: 4.6.1, 4.7.0
Known to fail: 4.6.0
Last reconfirmed:


Attachments
The .ii version of the code in the bug report (150 bytes, application/octet-stream)
2011-10-14 10:03 UTC, coyotte508
Details

Note You need to log in before you can comment on or make changes to this bug.
Description coyotte508 2011-10-14 10:03:40 UTC
Created attachment 25495 [details]
The .ii version of the code in the bug report

gcc version: gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Compile line: gcc -std="c++0x" test.cpp -save-temps
test.cpp:11:16: internal compiler error: in constructor_name_p, at cp/name-lookup.c:1809
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.

The .ii file is attached, but here is the source code:

enum class Foo {
    Val1,
    Val2
};

template <Foo val>
void do_something() {

}

template <Foo::Val1> //Error at this line
void do_something() {

}

int main() {
    return 0;
}

Possibly a duplicate of this bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47627, but the code is still different.
Comment 1 Paolo Carlini 2011-10-14 10:11:42 UTC
Has been fixed in 4.6.1, anyway.