Bug 70437 - [6 Regression] Instantiation loop with pair and is_constructible
Summary: [6 Regression] Instantiation loop with pair and is_constructible
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 6.0
: P1 normal
Target Milestone: 6.0
Assignee: Ville Voutilainen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-29 15:15 UTC by Jason Merrill
Modified: 2016-04-05 12:09 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-03-30 00:00:00


Attachments
First stab at a patch (428 bytes, patch)
2016-04-04 14:30 UTC, Ville Voutilainen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Merrill 2016-03-29 15:15:10 UTC
Reduced from https://github.com/openscad/openscad/issues/1575

#include <utility>

template <class T> struct B;

template <class T> struct A
{
  A(A&&) = default;
  A(const B<T> &);
};

template <class T> struct B
{
  std::pair<A<T>,int> a;
  B(B&&) = default;
};

bool b = std::is_move_constructible<A<int> >::value;

This seems similar to bug 65760.
Comment 1 Ville Voutilainen 2016-04-04 14:09:29 UTC
Mine.
Comment 2 Ville Voutilainen 2016-04-04 14:30:26 UTC
Created attachment 38179 [details]
First stab at a patch

Initial patch done, testsuite additions to follow, will submit once compile-farm testing is done.
Comment 3 ville 2016-04-05 11:32:02 UTC
Author: ville
Date: Tue Apr  5 11:31:30 2016
New Revision: 234743

URL: https://gcc.gnu.org/viewcvs?rev=234743&root=gcc&view=rev
Log:
 	PR libstdc++/70437
 	* include/bits/stl_pair.h (_ConstructiblePair,
	_ImplicitlyConvertiblePair, _MoveConstructiblePair,
	_ImplicitlyMoveConvertiblePair): Add shortcut conditions
	for same-type cases.
	* testsuite/20_util/pair/70437.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/20_util/pair/70437.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/stl_pair.h
Comment 4 Jonathan Wakely 2016-04-05 12:09:30 UTC
Fixed.