Commit 39bde5ea by Jason Merrill Committed by Jason Merrill

re PR c++/57388 ([C++11] ICE when function types with ref-qualifiers meet other function types)

	PR c++/57388
	* tree.c (build_ref_qualified_type): Clear
	FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.

From-SVN: r199269
parent 46aeac1b
2013-05-23 Jason Merrill <jason@redhat.com>
PR c++/57388
* tree.c (build_ref_qualified_type): Clear
FUNCTION_RVALUE_QUALIFIED for lvalue ref-qualifier.
2013-05-22 Jason Merrill <jason@redhat.com>
PR c++/56930
......
......@@ -1769,8 +1769,10 @@ build_ref_qualified_type (tree type, cp_ref_qualifier rqual)
{
case REF_QUAL_RVALUE:
FUNCTION_RVALUE_QUALIFIED (t) = 1;
/* Intentional fall through */
FUNCTION_REF_QUALIFIED (t) = 1;
break;
case REF_QUAL_LVALUE:
FUNCTION_RVALUE_QUALIFIED (t) = 0;
FUNCTION_REF_QUALIFIED (t) = 1;
break;
default:
......
// PR c++/57388
// { dg-require-effective-target c++11 }
template<class> struct A
{
static constexpr bool value = false;
};
template<class Res, class... Args>
struct A<Res(Args...)>
{
static constexpr bool value = true;
};
template<class Res, class... Args>
struct A<Res(Args...) const &>
{
static constexpr bool value = true;
};
template<class Res, class... Args>
struct A<Res(Args...) const &&>
{
static constexpr bool value = true;
};
static_assert(A<void()>::value, "Ouch");
static_assert(A<void() const &>::value, ""); // #1
static_assert(A<void() const &&>::value, ""); // #2
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