[Bug c++/50800] Internal compiler error in finish_member_declarations, possibly related to may_alias attribute
kretz at kde dot org
gcc-bugzilla@gcc.gnu.org
Fri Sep 26 12:48:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50800
Matthias Kretz <kretz at kde dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kretz at kde dot org
--- Comment #9 from Matthias Kretz <kretz at kde dot org> ---
I assume I hit the same issue. I got the testcase down to a few lines:
#include <type_traits>
template <typename L> typename std::remove_reference<L>::type foo(L &&lhs, int
rhs);
template <typename T> T d(T i)
{
enum { Size = sizeof(int) };
return foo(i, Size);
}
template <typename T> struct A {
typedef int TA __attribute__((__may_alias__));
};
int main()
{
typedef A<int> V;
typedef typename std::remove_reference<typename V::TA &>::type T;
return d(1);
}
It only needs the -std=c++11 flag. Tested to fail: 4.8.0/1/2/3 and 4.9.0/1/2
(4.9.2 is 20140924).
Backtrace from 4.9.2 snapshot:
/opt/gcc-4.9-snapshot/include/c++/4.9.2/type_traits:1488:5: internal compiler
error: in finish_member_declaration, at cp/semantics.c:2827
{ typedef _Tp type; };
^
0x6395c0 finish_member_declaration(tree_node*)
../.././gcc/cp/semantics.c:2827
0x5b975d instantiate_class_template_1
../.././gcc/cp/pt.c:9244
0x5b975d instantiate_class_template(tree_node*)
../.././gcc/cp/pt.c:9445
0x61039d complete_type(tree_node*)
../.././gcc/cp/typeck.c:134
0x5a8531 tsubst(tree_node*, tree_node*, int, tree_node*)
../.././gcc/cp/pt.c:12163
0x5acac7 tsubst_function_type
../.././gcc/cp/pt.c:11344
0x5a7e7f tsubst(tree_node*, tree_node*, int, tree_node*)
../.././gcc/cp/pt.c:12081
0x5ae8fe tsubst_decl
../.././gcc/cp/pt.c:10596
0x5a822f tsubst(tree_node*, tree_node*, int, tree_node*)
../.././gcc/cp/pt.c:11543
0x5b09fb instantiate_template_1
../.././gcc/cp/pt.c:15580
0x5b09fb instantiate_template(tree_node*, tree_node*, int)
../.././gcc/cp/pt.c:15630
0x5b6c2e fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
../.././gcc/cp/pt.c:15979
0x574031 add_template_candidate_real
../.././gcc/cp/call.c:2998
0x571984 add_template_candidate
../.././gcc/cp/call.c:3095
0x571984 add_candidates
../.././gcc/cp/call.c:5169
0x5755d9 perform_overload_resolution
../.././gcc/cp/call.c:3904
0x5770ea build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
../.././gcc/cp/call.c:3981
0x639891 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
../.././gcc/cp/semantics.c:2358
0x5a1b34 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../.././gcc/cp/pt.c:14861
0x5a519c tsubst_expr
../.././gcc/cp/pt.c:14048
More information about the Gcc-bugs
mailing list