From ffd466ddf50fc0ac2897d7184727ef60458d28f1 Mon Sep 17 00:00:00 2001 From: paolo Date: Sun, 17 Nov 2013 19:22:43 +0000 Subject: /cp 2013-11-17 Paolo Carlini PR c++/59123 * decl.c (validate_constexpr_redeclaration): Redeclarations of variables can differ in constexpr. /testsuite 2013-11-17 Paolo Carlini PR c++/59123 * g++.dg/cpp0x/constexpr-redeclaration1.C: New. * g++.dg/cpp0x/constexpr-decl.C: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204923 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/decl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/cp/decl.c') diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 7d9d5df8f1d..34d73be3e78 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1216,10 +1216,12 @@ validate_constexpr_redeclaration (tree old_decl, tree new_decl) if (! DECL_TEMPLATE_SPECIALIZATION (old_decl) && DECL_TEMPLATE_SPECIALIZATION (new_decl)) return true; + + error ("redeclaration %qD differs in %", new_decl); + error ("from previous declaration %q+D", old_decl); + return false; } - error ("redeclaration %qD differs in %", new_decl); - error ("from previous declaration %q+D", old_decl); - return false; + return true; } #define GNU_INLINE_P(fn) (DECL_DECLARED_INLINE_P (fn) \ -- cgit v1.2.1