+2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56913
+ * typeck2.c (build_m_component_ref): Protect error calls with
+ (complain & tf_error).
+
2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54216
{
bool lval = real_lvalue_p (datum);
if (lval && FUNCTION_RVALUE_QUALIFIED (type))
- error ("pointer-to-member-function type %qT requires an rvalue",
- ptrmem_type);
+ {
+ if (complain & tf_error)
+ error ("pointer-to-member-function type %qT requires an rvalue",
+ ptrmem_type);
+ return error_mark_node;
+ }
else if (!lval && !FUNCTION_RVALUE_QUALIFIED (type))
- error ("pointer-to-member-function type %qT requires an lvalue",
- ptrmem_type);
+ {
+ if (complain & tf_error)
+ error ("pointer-to-member-function type %qT requires an lvalue",
+ ptrmem_type);
+ return error_mark_node;
+ }
}
return build2 (OFFSET_REF, type, datum, component);
}
+2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/56913
+ * g++.dg/cpp0x/sfinae44.C: New.
+
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* ada/acats/run_all.sh: Remove special handling of -gnat95 switch.
--- /dev/null
+// PR c++/56913
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+T &&declval();
+
+template<typename T, typename U,
+ typename = decltype((declval<T>().*declval<U>())())>
+constexpr bool test(int)
+{
+ return true;
+}
+
+template<typename T, typename U>
+constexpr bool test(...)
+{
+ return false;
+}
+
+struct S
+{};
+
+static_assert(!test<S, void (S::*)() &>(0), "");
+static_assert(test<S, void (S::*)() &&>(0), "");
+static_assert(test<S &, void (S::*)() &>(0), "");
+static_assert(!test<S &, void (S::*)() &&>(0), "");