+2011-03-29 Jason Merrill <jason@redhat.com>
+
+ * semantics.c (is_valid_constexpr_fn): Specify input location.
+
2011-03-28 Jason Merrill <jason@redhat.com>
PR c++/48313
{
ret = false;
if (complain)
- error ("invalid type for parameter %q#D of constexpr function",
- parm);
+ error ("invalid type for parameter %d of constexpr "
+ "function %q+#D", DECL_PARM_INDEX (parm), fun);
}
if (!DECL_CONSTRUCTOR_P (fun))
{
ret = false;
if (complain)
- error ("invalid return type %qT of constexpr function %qD",
+ error ("invalid return type %qT of constexpr function %q+D",
rettype, fun);
}
{
ret = false;
if (complain)
- error ("enclosing class of %q#D is not a literal type", fun);
+ error ("enclosing class of %q+#D is not a literal type", fun);
}
}
+2011-03-29 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-diag1.C: Adjust error locations.
+
2011-03-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/48095
// Test that we explain why a template instantiation isn't constexpr
// { dg-options -std=c++0x }
-// { dg-prune-output "not a constexpr function" }
template <class T>
struct A
{
T t;
- constexpr int f() { return 42; }
+ constexpr int f() { return 42; } // { dg-error "enclosing class" }
};
struct B { B(); operator int(); };
constexpr A<int> ai = { 42 };
constexpr int i = ai.f();
-constexpr int b = A<B>().f(); // { dg-error "enclosing class" }
+constexpr int b = A<B>().f(); // { dg-error "not a constexpr function" }
template <class T>
-constexpr int f (T t) { return 42; }
-constexpr int x = f(B()); // { dg-error "parameter" }
+constexpr int f (T t) { return 42; } // { dg-error "parameter" }
+constexpr int x = f(B()); // { dg-error "constexpr function" }