mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/65339 (C++ ICE with lambda and no capture list)
PR c++/65339 * call.c: Don't call maybe_resolve_dummy when calling a constructor. From-SVN: r221285
This commit is contained in:
parent
01177669b2
commit
a2f259ef04
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-03-09 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/65339
|
||||||
|
* call.c: Don't call maybe_resolve_dummy when calling a constructor.
|
||||||
|
|
||||||
2015-03-09 Jakub Jelinek <jakub@redhat.com>
|
2015-03-09 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR c/65120
|
PR c/65120
|
||||||
|
|
|
||||||
|
|
@ -8020,7 +8020,11 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
|
||||||
that would be captured if the call turns out to be to a
|
that would be captured if the call turns out to be to a
|
||||||
non-static member function. Do not actually capture it at this
|
non-static member function. Do not actually capture it at this
|
||||||
point. */
|
point. */
|
||||||
first_mem_arg = maybe_resolve_dummy (instance, false);
|
if (DECL_CONSTRUCTOR_P (fn))
|
||||||
|
/* Constructors don't use the enclosing 'this'. */
|
||||||
|
first_mem_arg = instance;
|
||||||
|
else
|
||||||
|
first_mem_arg = maybe_resolve_dummy (instance, false);
|
||||||
|
|
||||||
/* Get the high-water mark for the CONVERSION_OBSTACK. */
|
/* Get the high-water mark for the CONVERSION_OBSTACK. */
|
||||||
p = conversion_obstack_alloc (0);
|
p = conversion_obstack_alloc (0);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
// PR c++/65339
|
||||||
|
// { dg-do compile { target c++11 } }
|
||||||
|
|
||||||
|
class FuncWrapper {
|
||||||
|
public:
|
||||||
|
template <typename Func> void callfunc(Func f)
|
||||||
|
{
|
||||||
|
f();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class Object {
|
||||||
|
int field;
|
||||||
|
public:
|
||||||
|
void Method();
|
||||||
|
Object() { field = 555; }
|
||||||
|
Object(const Object&) { __builtin_abort(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
void Object::Method ()
|
||||||
|
{
|
||||||
|
FuncWrapper wrap;
|
||||||
|
wrap.callfunc(*[]()
|
||||||
|
{
|
||||||
|
return Object();
|
||||||
|
});
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue