diff options
author | Jason Merrill <jason@redhat.com> | 2010-10-27 11:54:45 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-10-27 11:54:45 -0400 |
commit | 2842beb62d01d883db7c770291e15f4de8202174 (patch) | |
tree | 10a74c8960573deac8cfa489fffd88c567b6c2b3 /gcc/cp | |
parent | efd7ad5c5eeb7ba12d1458cc9c10a0010eb355b0 (diff) | |
download | gcc-2842beb62d01d883db7c770291e15f4de8202174.zip gcc-2842beb62d01d883db7c770291e15f4de8202174.tar.gz gcc-2842beb62d01d883db7c770291e15f4de8202174.tar.bz2 |
* error.c (dump_simple_decl): Print constexpr.
From-SVN: r166010
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/error.c | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d400657..4bbb0db 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2010-10-27 Jason Merrill <jason@redhat.com> + * error.c (dump_simple_decl): Print constexpr. + * cvt.c (build_up_reference): Use target_type for the temporary var. * except.c (build_throw): Set EXPR_LOCATION. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 588cbe8..9ad2b93 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -867,6 +867,9 @@ dump_simple_decl (tree t, tree type, int flags) { if (flags & TFF_DECL_SPECIFIERS) { + if (TREE_CODE (t) == VAR_DECL + && DECL_DECLARED_CONSTEXPR_P (t)) + pp_cxx_ws_string (cxx_pp, "constexpr"); dump_type_prefix (type, flags & ~TFF_UNQUALIFIED_NAME); pp_maybe_space (cxx_pp); } @@ -1306,12 +1309,16 @@ dump_function_decl (tree t, int flags) else if (TREE_CODE (fntype) == METHOD_TYPE) cname = TREE_TYPE (TREE_VALUE (parmtypes)); - if (!(flags & TFF_DECL_SPECIFIERS)) - /* OK */; - else if (DECL_STATIC_FUNCTION_P (t)) - pp_cxx_ws_string (cxx_pp, "static"); - else if (DECL_VIRTUAL_P (t)) - pp_cxx_ws_string (cxx_pp, "virtual"); + if (flags & TFF_DECL_SPECIFIERS) + { + if (DECL_STATIC_FUNCTION_P (t)) + pp_cxx_ws_string (cxx_pp, "static"); + else if (DECL_VIRTUAL_P (t)) + pp_cxx_ws_string (cxx_pp, "virtual"); + + if (DECL_DECLARED_CONSTEXPR_P (STRIP_TEMPLATE (t))) + pp_cxx_ws_string (cxx_pp, "constexpr"); + } /* Print the return type? */ if (show_return) |