Commit 2701664a by Jason Merrill Committed by Jason Merrill

re PR c++/56915 (ICE in symtab_add_to_same_comdat_group, at symtab.c:383)

	PR c++/56915
	* semantics.c (maybe_add_lambda_conv_op): Give up if the call op
	isn't defined.

From-SVN: r199231
parent cfb00b41
2013-05-22 Jason Merrill <jason@redhat.com>
PR c++/56915
* semantics.c (maybe_add_lambda_conv_op): Give up if the call op
isn't defined.
2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57352
......
......@@ -9784,6 +9784,13 @@ maybe_add_lambda_conv_op (tree type)
if (processing_template_decl)
return;
if (DECL_INITIAL (callop) == NULL_TREE)
{
/* If the op() wasn't instantiated due to errors, give up. */
gcc_assert (errorcount || sorrycount);
return;
}
stattype = build_function_type (TREE_TYPE (TREE_TYPE (callop)),
FUNCTION_ARG_CHAIN (callop));
......
// PR c++/56915
// { dg-require-effective-target c++11 }
template <typename T>
class A
{
typename T::type b(); // { dg-error "int" }
};
template <typename T, typename U>
void waldo(T, U) {}
template <typename T>
void bar()
{
waldo([](A<T> a){ return a; },
[]{});
}
int main()
{
bar<int>();
}
// { dg-prune-output "used but never defined" }
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