2012-07-02 Jason Merrill <jason@redhat.com>
+ PR c++/53788
+ * pt.c (build_non_dependent_expr): Don't wrap a dummy object.
+
PR c++/53816
* class.c (resolves_to_fixed_type_p): Check uses_template_parms
(current_function_decl) instead of processing_template_decl.
if (BRACE_ENCLOSED_INITIALIZER_P (expr))
return expr;
+ /* Don't wrap a dummy object, we need to be able to test for it. */
+ if (is_dummy_object (expr))
+ return expr;
+
if (TREE_CODE (expr) == COND_EXPR)
return build3 (COND_EXPR,
TREE_TYPE (expr),
2012-07-02 Jason Merrill <jason@redhat.com>
+ PR c++/53788
+ * g++.dg/cpp0x/decltype39.C: New.
+ * g++.dg/diagnostic/method1.C: Adjust.
+
PR c++/53816
* g++.dg/template/ref6.C: New.
--- /dev/null
+// PR c++/53788
+// { dg-do compile { target c++11 } }
+
+struct t { static const bool value = true; };
+struct f { static const bool value = false; };
+
+template<typename T>
+struct has_static {
+ template<typename X>
+ static t check(X*, decltype(T::fun())* = 0); // { dg-error "without object" }
+ static f check(...);
+
+ typedef decltype(check((T*)(0))) ret;
+ static const bool value = ret::value;
+};
+
+struct test { int fun() { return 0; } };
+
+bool b = has_static<test>::value;
void
bar ()
{
- A::foo ().anything; // { dg-error "request for member" }
+ A::foo ().anything; // { dg-error "without object" }
}
void
{
bar <int> ();
}
-
-// { dg-prune-output "without object" }