Commit cc49d15a by Paolo Carlini Committed by Paolo Carlini

re PR c++/80186 (ICE on C++ code with invalid constructor: Segmentation fault (program cc1plus))

/cp
2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/80186
	* pt.c (tsubst_decl): Early return error_mark_node if
	grok_ctor_properties returns false.

/testsuite
2017-05-09  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/80186
	* g++.dg/template/crash126.C: New.

From-SVN: r247807
parent 85282abc
2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80186
* pt.c (tsubst_decl): Early return error_mark_node if
grok_ctor_properties returns false.
2017-05-09 Jason Merrill <jason@redhat.com>
PR c++/70167 - array prvalue treated as lvalue
......
......@@ -12407,8 +12407,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
if (DECL_CONSTRUCTOR_P (r) || DECL_DESTRUCTOR_P (r))
{
maybe_retrofit_in_chrg (r);
if (DECL_CONSTRUCTOR_P (r))
grok_ctor_properties (ctx, r);
if (DECL_CONSTRUCTOR_P (r) && !grok_ctor_properties (ctx, r))
RETURN (error_mark_node);
/* If this is an instantiation of a member template, clone it.
If it isn't, that'll be handled by
clone_constructors_and_destructors. */
......
2017-05-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80186
* g++.dg/template/crash126.C: New.
2017-05-09 Sebastian Peryt <sebastian.peryt@intel.com>
* gcc.target/i386/avx512f-vaddsd-2.c: Test fixed.
......
// PR c++/80186
template < class T, class > struct A
{
A ();
A (A &);
A (A < T, T >); // { dg-error "invalid constructor" }
};
void f ()
{
A < int, int > (A < int, int >()); // { dg-error "cannot bind" }
}
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