]> git.ipfire.org Git - thirdparty/gcc.git/commit
[C++] Avoid exposing internal details in aka types
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 22 Oct 2019 07:47:07 +0000 (07:47 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 22 Oct 2019 07:47:07 +0000 (07:47 +0000)
commit10bce48f104de56503b17954ed79f019df3252e3
tree31f95815c57840905ddcf9b8efc15e4cd333833a
parent24b54eb2fd9ee616d899683a459756072e3a1c4d
[C++] Avoid exposing internal details in aka types

This patch extends r276951 to work for C++ too.

2019-10-22  Richard Sandiford  <richard.sandiford@arm.com>

gcc/cp/
* cp-tree.h (STF_USER_VISIBLE): New constant.
(strip_typedefs, strip_typedefs_expr): Take a flags argument.
* tree.c (strip_typedefs, strip_typedefs_expr): Likewise,
updating mutual calls accordingly.  When STF_USER_VISIBLE is true,
only look through typedefs if user_facing_original_type_p.
* error.c (dump_template_bindings, type_to_string): Pass
STF_USER_VISIBLE to strip_typedefs.
(dump_type): Likewise, unless pp_c_flag_gnu_v3 is set.

gcc/testsuite/
* g++.dg/diagnostic/aka5.h: New test.
* g++.dg/diagnostic/aka5a.C: Likewise.
* g++.dg/diagnostic/aka5b.C: Likewise.
* g++.target/aarch64/diag_aka_1.C: Likewise.

From-SVN: r277281
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/error.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/aka5.h [new file with mode: 0644]
gcc/testsuite/g++.dg/diagnostic/aka5a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/diagnostic/aka5b.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/diag_aka_1.C [new file with mode: 0644]