This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84181] [8 Regression] ICE in variadic lambda inside a template when accessing any member after decltype
- From: "benni.buch at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Feb 2018 20:49:55 +0000
- Subject: [Bug c++/84181] [8 Regression] ICE in variadic lambda inside a template when accessing any member after decltype
- Auto-submitted: auto-generated
- References: <bug-84181-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84181
Benjamin Buch <benni.buch at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #4 from Benjamin Buch <benni.buch at gmail dot com> ---
Thanks for your fast patching!
I found another variant of this bug if you use a variable template instead of a
function:
template < int ... I >
struct A{};
template < typename T >
auto var = [](auto ... i){
return A< decltype(i)::x ... >{};
};
int main(){
var< int >();
}
$ g++ -std=c++14 main3.cpp
main3.cpp: In instantiation of '<lambda(auto:1 ...)> [with auto:1 = {}]':
main3.cpp:10:16: required from here
main3.cpp:6:40: internal compiler error: Segmentation fault
return A< decltype(i)::x ... >{};
^
0xe79ecf crash_signal
../../gcc/gcc/toplev.c:325
0x916d50 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3245
0x916d50 enclosing_instantiation_of
../../gcc/gcc/cp/pt.c:12694
0x942a7e tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:11450
0x94452a tsubst_template_args
../../gcc/gcc/cp/pt.c:11836
0x944438 tsubst_template_args
../../gcc/gcc/cp/pt.c:11854
0x940d15 tsubst_aggr_type
../../gcc/gcc/cp/pt.c:12067
0x93b25e tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/gcc/cp/pt.c:13706
0x926df4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:18153
0x934e29 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/gcc/cp/pt.c:17100
0x934e29 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16838
0x932e80 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16055
0x931f41 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16322
0x931f41 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16322
0x931f41 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16322
0x9311d8 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/gcc/cp/pt.c:16030
0x9311d8 instantiate_decl(tree_node*, bool, bool)
../../gcc/gcc/cp/pt.c:23384
0x87aeeb maybe_instantiate_decl
../../gcc/gcc/cp/decl2.c:5178
0x87ccf8 mark_used(tree_node*, int)
../../gcc/gcc/cp/decl2.c:5273
0x7e7c90 build_over_call
../../gcc/gcc/cp/call.c:8201
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.