[Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 19 17:46:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Last reconfirmed|2014-09-26 00:00:00 |2016-1-19
CC| |msebor at gcc dot gnu.org
Known to fail| |6.0
--- Comment #15 from Martin Sebor <msebor at gcc dot gnu.org> ---
Today's trunk still crashes on the (invalid) test case in comment #7. Below is
an ever so slightly more reduced test case that reproduces the failure. The
patch from comment #11 still fixes the ICE and produces the following output:
u.c: In function ‘void f(A<T>*)’:
u.c:16:8: error: ‘class C<B<T>, int>::U’ resolves to ‘C<B<int>, int>::U {aka
int}’, which is is not a class type
A<int>* map;
^
u.c:17:9: error: no matching function for call to ‘f(A<int>*&)’
f (map);
^
u.c:15:6: note: candidate: template<class T> void f(A<T>*)
void f (A<T>*) {
^
u.c:15:6: note: template argument deduction/substitution failed:
u.c:17:9: note: template argument ‘0’ does not match ‘x’
f (map);
^
Slightly reduced test case:
$ cat u.c && /build/gcc-trunk/gcc/xgcc -B /build/gcc-trunk/gcc -S -Wall -Wextra
-Wpedantic -xc++ u.c
template <class T>
struct B { };
template <class, class T>
struct C {
typedef T U;
};
const int x = 0;
template <class T, class C<B<T>, int>::U = x>
struct A;
template <class T>
void f (A<T>*) {
A<int>* map;
f (map);
}
u.c: In function ‘void f(A<T>*)’:
u.c:16:8: error: ‘class C<B<T>, int>::U’ resolves to ‘C<B<int>, int>::U {aka
int}’, which is is not a class type
A<int>* map;
^
u.c: In substitution of ‘template<class T> void f(A<T>*) [with T = <missing>]’:
u.c:17:9: required from here
u.c:17:9: internal compiler error: in unify, at cp/pt.c:19935
f (map);
^
0x10440953 unify
/src/gcc/trunk/gcc/cp/pt.c:19935
0x1043f30b unify
/src/gcc/trunk/gcc/cp/pt.c:19768
0x104384a7 try_class_unification
/src/gcc/trunk/gcc/cp/pt.c:18772
0x1043f803 unify
/src/gcc/trunk/gcc/cp/pt.c:19806
0x1043eb77 unify
/src/gcc/trunk/gcc/cp/pt.c:19672
0x10435643 unify_one_argument
/src/gcc/trunk/gcc/cp/pt.c:18121
0x10435983 type_unification_real
/src/gcc/trunk/gcc/cp/pt.c:18195
0x104334a7 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
/src/gcc/trunk/gcc/cp/pt.c:17623
0x1032e533 add_template_candidate_real
/src/gcc/trunk/gcc/cp/call.c:3091
0x1032ea8f add_template_candidate
/src/gcc/trunk/gcc/cp/call.c:3169
0x10338b3f add_candidates
/src/gcc/trunk/gcc/cp/call.c:5341
0x10332893 perform_overload_resolution
/src/gcc/trunk/gcc/cp/call.c:4026
0x10332c1f build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
/src/gcc/trunk/gcc/cp/call.c:4103
0x105f857b finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
/src/gcc/trunk/gcc/cp/semantics.c:2413
0x10500dbb cp_parser_postfix_expression
/src/gcc/trunk/gcc/cp/parser.c:6884
0x10503d5f cp_parser_unary_expression
/src/gcc/trunk/gcc/cp/parser.c:7964
0x1050516b cp_parser_cast_expression
/src/gcc/trunk/gcc/cp/parser.c:8641
0x10505293 cp_parser_binary_expression
/src/gcc/trunk/gcc/cp/parser.c:8743
0x105064a7 cp_parser_assignment_expression
/src/gcc/trunk/gcc/cp/parser.c:9031
0x10506a2b cp_parser_expression
/src/gcc/trunk/gcc/cp/parser.c:9198
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
More information about the Gcc-bugs
mailing list