internal compiler error: in cxx_eval_indirect_ref, at cp/semantics.c:7435
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-4.7 (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
This error occurs when I try to compile this seven-line file.
#include <tuple>
template< class X > struct Hold {
X x;
constexpr Hold( X x ) : x(std::move(x)) { }
};
constexpr auto a = Hold<int>( 1 ); //ok
constexpr auto b = Hold<std:
(See compiler output below.)
1) OS Release info:
Description: Ubuntu 12.10
Release: 12.10
2) Gcc version:
g++:
Installed: 4:4.7.2-1ubuntu2
Candidate: 4:4.7.2-1ubuntu2
Version table:
*** 4:4.7.2-1ubuntu2 0
500 http://
100 /var/lib/
3) Expectation:
This will compile such that Hold.x is a tuple<int> that holds just 1. I assume that std::tuple is movable and constexpr.
According to Ideone, GCC 4.5 rejects this, but does not crash. http://
4) Actual:
sandbox$ g++ -v -save-temps -std=c++11 test.cpp
Using built-in specs.
COLLECT_GCC=g++
COLLECT_
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-4precise1)
COLLECT_
/usr/lib/
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/Linaro 4.7.2-4precise1) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.2, MPFR version 3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
GNU C++ (Ubuntu/Linaro 4.7.2-4precise1) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.2, MPFR version 3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-
Compiler executable checksum: a1c501d12da152c
test.cpp:8:62: in constexpr expansion of 'Hold<std:
test.cpp:5:40: in constexpr expansion of '((Hold<
test.cpp:8:62: internal compiler error: in cxx_eval_
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
Preprocessed source stored into /tmp/ccebWdLK.out file, please attach this to your bugreport.
I have also produced this with gcc 4.8:
sandbox$ /usr/lib/
Using built-in specs.
COLLECT_
COLLECT_
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-
Thread model: posix
gcc version 4.8.0 20121008 (experimental) [trunk revision 192192] (Ubuntu/Linaro 20121008-1ubuntu1)
COLLECT_
/usr/lib/
ignoring nonexistent directory "/usr/local/
ignoring nonexistent directory "/usr/lib/
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/local/include
/usr/lib/
/usr/include/
/usr/include
End of search list.
COLLECT_
/usr/lib/
GNU C++ (Ubuntu/Linaro 20121008-1ubuntu1) version 4.8.0 20121008 (experimental) [trunk revision 192192] (x86_64-linux-gnu)
compiled by GNU C version 4.8.0 20121008 (experimental) [trunk revision 192192], GMP version 5.0.2, MPFR version 3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-
GNU C++ (Ubuntu/Linaro 20121008-1ubuntu1) version 4.8.0 20121008 (experimental) [trunk revision 192192] (x86_64-linux-gnu)
compiled by GNU C version 4.8.0 20121008 (experimental) [trunk revision 192192], GMP version 5.0.2, MPFR version 3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-
Compiler executable checksum: be9316d4d24873f
test.cpp:8:62: in constexpr expansion of 'Hold<std:
test.cpp:5:40: in constexpr expansion of '((Hold<
test.cpp:8:62: internal compiler error: in cxx_eval_
constexpr auto b = Hold<std:
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
Preprocessed source stored into /tmp/ccGrrfHl.out file, please attach this to your bugreport.
Triaged: Trivially repeatable test case
Fails on g++ 4:4.7.2-1ubuntu7 on current Raring.