This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68683] New: [concepts] function satisfy_argument_deduction_constraint modifies a type tree node but leaves TYPE_CANONICAL unchanged
- From: "ryan.burn at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Dec 2015 18:02:06 +0000
- Subject: [Bug c++/68683] New: [concepts] function satisfy_argument_deduction_constraint modifies a type tree node but leaves TYPE_CANONICAL unchanged
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68683
Bug ID: 68683
Summary: [concepts] function
satisfy_argument_deduction_constraint modifies a type
tree node but leaves TYPE_CANONICAL unchanged
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ryan.burn at gmail dot com
Target Milestone: ---
The below code causes a "same canonical type node for different types" ICE
because the function satisfy_argument_deduction_constraint changes the
PLACEHOLDER_TYPE_CONSTRAINTS for a tree node but leaves the TYPE_CANONICAL
value unchanged. Since PLACEHOLDER_TYPE_CONSTRAINTS are used when checking for
equality, \ the TYPE_CANONICAL value is no longer valid for the changed type
which triggers the ICE.
///////////////////////////////////////////////////////////////////
template <typename, typename>
struct is_same {
static constexpr bool value = true;
};
template <typename T, typename U>
concept bool Same = is_same<T, U>::value;
template <typename T>
concept bool Integral = requires{
{ T() } -> Same<typename T::value_type>;
};
struct A {
using value_type = bool;
};
int main() {
Integral<A>;
Integral<A>;
return 0;
}
///////////////////////////////////////////////////////////////////