aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2016-06-17 20:01:46 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2016-06-17 20:01:46 +0000
commitc561b09181d6543d310f203072f5940604df3fb9 (patch)
tree81fe3c5382f90ca9d828af92253a0a05f55ef1c9 /gcc/cp/error.c
parentce20977799be679bf8769522e94b72d32b781fde (diff)
downloadgcc-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/error.c')
-rw-r--r--gcc/cp/error.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 7d70f89..d5a7d0f 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1486,6 +1486,7 @@ dump_function_decl (cxx_pretty_printer *pp, tree t, int flags)
int show_return = flags & TFF_RETURN_TYPE || flags & TFF_DECL_SPECIFIERS;
int do_outer_scope = ! (flags & TFF_UNQUALIFIED_NAME);
tree exceptions;
+ bool constexpr_p;
flags &= ~(TFF_UNQUALIFIED_NAME | TFF_TEMPLATE_NAME);
if (TREE_CODE (t) == TEMPLATE_DECL)
@@ -1495,6 +1496,9 @@ dump_function_decl (cxx_pretty_printer *pp, tree t, int flags)
emitting an error about incompatible specifications. */
exceptions = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (t));
+ /* Likewise for the constexpr specifier, in case t is a specialization. */
+ constexpr_p = DECL_DECLARED_CONSTEXPR_P (t);
+
/* Pretty print template instantiations only. */
if (DECL_USE_TEMPLATE (t) && DECL_TEMPLATE_INFO (t)
&& flag_pretty_templates)
@@ -1529,7 +1533,7 @@ dump_function_decl (cxx_pretty_printer *pp, tree t, int flags)
else if (DECL_VIRTUAL_P (t))
pp_cxx_ws_string (pp, "virtual");
- if (DECL_DECLARED_CONSTEXPR_P (t))
+ if (constexpr_p)
pp_cxx_ws_string (pp, "constexpr");
}