aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.cc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2022-09-28 09:20:27 -0700
committerNathan Sidwell <nathan@acm.org>2022-09-28 13:43:07 -0700
commit9f65eecdbef6027722e93aadf3fa6b3cc342eb4f (patch)
treef48eebe3d44d85a5326b75a3a609ebc0b3a8c5fb /gcc/cp/error.cc
parentdb288230db55dc1ff626f46c708b555847013a41 (diff)
downloadgcc-9f65eecdbef6027722e93aadf3fa6b3cc342eb4f.zip
gcc-9f65eecdbef6027722e93aadf3fa6b3cc342eb4f.tar.gz
gcc-9f65eecdbef6027722e93aadf3fa6b3cc342eb4f.tar.bz2
c++: Add DECL_NTTP_OBJECT_P lang flag
VAR_DECLs for NTTPs need to be handled specially by module streaming, in the same manner to type info decls. This reworks their handling to allow that work to drop in. We use DECL_LANG_FLAG_5 to indicate such decls (I didn't notice template_parm_object_p, which looks at the mangled name -- anyway a bit flag on the node is better, IMHO). We break apart the creation routine, so there's now an entry point the module machinery can use directly. gcc/cp/ * cp-tree.h (DECL_NTTP_OBJECT_P): New. (template_parm_object_p): Delete. (build_template_parm_object): Declare. * cxx-pretty-print.cc (pp_cx_template_argument_list): Use DECL_NTTP_OBJECT_P. * error.cc (dump_simple_decl): Likewise. * mangle.cc (write_template_arg): Likewise. * pt.cc (template_parm_object_p): Delete. (create_template_parm_object): Separated out checking from ... (get_template_parm_object): ... this, new external entry point.
Diffstat (limited to 'gcc/cp/error.cc')
-rw-r--r--gcc/cp/error.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/error.cc b/gcc/cp/error.cc
index 0389f35..53904e3 100644
--- a/gcc/cp/error.cc
+++ b/gcc/cp/error.cc
@@ -1129,7 +1129,7 @@ dump_global_iord (cxx_pretty_printer *pp, tree t)
static void
dump_simple_decl (cxx_pretty_printer *pp, tree t, tree type, int flags)
{
- if (template_parm_object_p (t))
+ if (TREE_CODE (t) == VAR_DECL && DECL_NTTP_OBJECT_P (t))
return dump_expr (pp, DECL_INITIAL (t), flags);
if (flags & TFF_DECL_SPECIFIERS)