[4.9/4.10 Regression] ICE when static_cast from constexpr in specialization of template-class
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Unknown
|
Unknown
|
|||
gcc-4.9 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The associated upstream bug-report can be found at http://
'lsb_release -rd' :
Description: Ubuntu 14.04 LTS
Release: 14.04
'apt-cache policy pkgname':
gcc-4.9:
Installiert: 4.9-20140406-
Installations
Versionstabelle:
*** 4.9-20140406-
500 http://
100 /var/lib/
For completion I copy the content of the upstream bug-report here, too:
The following code produces an internal compiler error (ICE) in GCC 4.9, but did compile fine in GCC 4.8:
<code>
// general template
template <typename A>
struct foo
{
};
// template specialization
template<>
struct foo<int>
{
static constexpr int code = 42;
unsigned int bar = static_
// ICE at static_cast during instantiation. --^
};
// instantiation
foo<int> a;
</code>
Compiling with the following line (using GCC 4.9) reproduced the ICE:
g++ -Wall -Wextra -std=c++11 -c ICE.cpp
The output of 'g++ -v -save-temps -Wall -Wextra -std=c++11 -c ICE.cpp' yields the following information:
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-
Thread model: posix
gcc version 4.9.0 20140405 (experimental) [trunk revision 209157] (Ubuntu 4.9-20140406-
COLLECT_
/usr/lib/
ignoring duplicate directory "/usr/include/
ignoring nonexistent directory "/usr/local/
ignoring nonexistent directory "/usr/lib/
#include "..." search starts here:
#include <...> search starts here:
/usr/include/
/usr/include/
/usr/include/
/usr/lib/
/usr/local/include
/usr/lib/
/usr/include/
/usr/include
End of search list.
COLLECT_
/usr/lib/
GNU C++ (Ubuntu 4.9-20140406-
compiled by GNU C version 4.9.0 20140405 (experimental) [trunk revision 209157], GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
GNU C++ (Ubuntu 4.9-20140406-
compiled by GNU C version 4.9.0 20140405 (experimental) [trunk revision 209157], GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
Compiler executable checksum: 6752b609dd6385b
ICE.cpp:17:10: in constexpr expansion of ‘a.foo<int>::foo()’
ICE.cpp:17:10: internal compiler error: unexpected expression ‘static_
foo<int> a;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
Preprocessed source stored into /tmp/cc5DJH1d.out file, please attach this to your bugreport.
summary: |
- [4.9 Regression] ICE when static_cast from constexpr in specialization - of template-class + [4.9/4.10 Regression] ICE when static_cast from constexpr in + specialization of template-class |
Fixed upstream.