1 From 7ca62e4f7e0e27a4282dc14e5b89c389d5c194bb Mon Sep 17 00:00:00 2001
2 From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Tue, 29 Mar 2011 14:26:21 +0000
4 Subject: [PATCH 033/200] * semantics.c (is_valid_constexpr_fn): Specify input location.
6 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@171674 138bc75d-0d04-0410-961f-82ee72b054a4
8 index 23bb021..a41a1d5 100644
9 --- a/gcc/cp/semantics.c
10 +++ b/gcc/cp/semantics.c
11 @@ -5390,8 +5390,8 @@ is_valid_constexpr_fn (tree fun, bool complain)
15 - error ("invalid type for parameter %q#D of constexpr function",
17 + error ("invalid type for parameter %d of constexpr "
18 + "function %q+#D", DECL_PARM_INDEX (parm), fun);
21 if (!DECL_CONSTRUCTOR_P (fun))
22 @@ -5401,7 +5401,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
26 - error ("invalid return type %qT of constexpr function %qD",
27 + error ("invalid return type %qT of constexpr function %q+D",
31 @@ -5411,7 +5411,7 @@ is_valid_constexpr_fn (tree fun, bool complain)
35 - error ("enclosing class of %q#D is not a literal type", fun);
36 + error ("enclosing class of %q+#D is not a literal type", fun);
40 index a3706d6..183d3f7 100644
41 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-diag1.C
42 +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag1.C
44 // Test that we explain why a template instantiation isn't constexpr
45 // { dg-options -std=c++0x }
46 -// { dg-prune-output "not a constexpr function" }
52 - constexpr int f() { return 42; }
53 + constexpr int f() { return 42; } // { dg-error "enclosing class" }
56 struct B { B(); operator int(); };
57 @@ -14,8 +13,8 @@ struct B { B(); operator int(); };
58 constexpr A<int> ai = { 42 };
59 constexpr int i = ai.f();
61 -constexpr int b = A<B>().f(); // { dg-error "enclosing class" }
62 +constexpr int b = A<B>().f(); // { dg-error "not a constexpr function" }
65 -constexpr int f (T t) { return 42; }
66 -constexpr int x = f(B()); // { dg-error "parameter" }
67 +constexpr int f (T t) { return 42; } // { dg-error "parameter" }
68 +constexpr int x = f(B()); // { dg-error "constexpr function" }