diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2016-06-17 20:01:46 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2016-06-17 20:01:46 +0000 |
commit | c561b09181d6543d310f203072f5940604df3fb9 (patch) | |
tree | 81fe3c5382f90ca9d828af92253a0a05f55ef1c9 /gcc/cp/decl.c | |
parent | ce20977799be679bf8769522e94b72d32b781fde (diff) | |
download | gcc-c561b09181d6543d310f203072f5940604df3fb9.zip gcc-c561b09181d6543d310f203072f5940604df3fb9.tar.gz gcc-c561b09181d6543d310f203072f5940604df3fb9.tar.bz2 |
decl.c (validate_constexpr_redeclaration): Change pair of errors to error + inform.
/cp
2016-06-17 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (validate_constexpr_redeclaration): Change pair of errors
to error + inform.
* error.c (dump_function_decl): Save the constexpr specifier too.
/testsuite
2016-06-17 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/constexpr-specialization.C: Adjust for dg-message
vs dg-error; test constexpr specifier too.
From-SVN: r237564
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 59abd15..c86a131 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1281,8 +1281,11 @@ validate_constexpr_redeclaration (tree old_decl, tree new_decl) && DECL_TEMPLATE_SPECIALIZATION (new_decl)) return true; - error ("redeclaration %q+D differs in %<constexpr%>", new_decl); - error ("from previous declaration %q+D", old_decl); + error_at (DECL_SOURCE_LOCATION (new_decl), + "redeclaration %qD differs in %<constexpr%> " + "from previous declaration", new_decl); + inform (DECL_SOURCE_LOCATION (old_decl), + "previous declaration %qD", old_decl); return false; } return true; |