Commit d15f0fa7 by Marek Polacek Committed by Marek Polacek

re PR c++/84125 (ICE in generic lambda when static_assert argument is implicitly converted to bool)

	PR c++/84125
	* typeck.c (build_address): Relax the assert when
	processing_template_decl.

	* g++.dg/cpp1y/lambda-generic-84125.C:New test.

From-SVN: r257311
parent ae976c33
2018-02-01 Marek Polacek <polacek@redhat.com>
PR c++/84125
* typeck.c (build_address): Relax the assert when
processing_template_decl.
2018-02-01 Jason Merrill <jason@redhat.com>
PR c++/84126 - ICE with variadic generic lambda
......
......@@ -5735,7 +5735,8 @@ build_address (tree t)
{
if (error_operand_p (t) || !cxx_mark_addressable (t))
return error_mark_node;
gcc_checking_assert (TREE_CODE (t) != CONSTRUCTOR);
gcc_checking_assert (TREE_CODE (t) != CONSTRUCTOR
|| processing_template_decl);
t = build_fold_addr_expr_loc (EXPR_LOCATION (t), t);
if (TREE_CODE (t) != ADDR_EXPR)
t = rvalue (t);
......
2018-02-01 Marek Polacek <polacek@redhat.com>
PR c++/84125
* g++.dg/cpp1y/lambda-generic-84125.C:New test.
2018-01-30 Jeff Law <law@redhat.com>
PR target/84128
......
// PR c++/84125
// { dg-do compile { target c++14 } }
struct X { constexpr operator bool() const { return true; } };
int main(){
[](auto) {
static_assert(X{}, "");
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment