summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-17 19:22:43 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-17 19:22:43 +0000
commitffd466ddf50fc0ac2897d7184727ef60458d28f1 (patch)
tree483fcf1dc18945fe85a739b84937042cd4f208c3 /gcc/cp/decl.c
parentd5816376f3f8392e35ecf54db80538742c22a1fe (diff)
downloadgcc-ffd466ddf50fc0ac2897d7184727ef60458d28f1.tar.gz
/cp
2013-11-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59123 * decl.c (validate_constexpr_redeclaration): Redeclarations of variables can differ in constexpr. /testsuite 2013-11-17 Paolo Carlini <paolo.carlini@oracle.com> 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
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c8
1 files changed, 5 insertions, 3 deletions
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 %<constexpr%>", new_decl);
+ error ("from previous declaration %q+D", old_decl);
+ return false;
}
- error ("redeclaration %qD differs in %<constexpr%>", new_decl);
- error ("from previous declaration %q+D", old_decl);
- return false;
+ return true;
}
#define GNU_INLINE_P(fn) (DECL_DECLARED_INLINE_P (fn) \