+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
{
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:
--- /dev/null
+// 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