diff options
author | Marek Polacek <polacek@redhat.com> | 2019-12-05 20:06:46 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2019-12-05 20:06:46 +0000 |
commit | 5c04da88731961636d08c0fd06f2aa291410d5b9 (patch) | |
tree | 3d47b17b0b603fea3e1891725ae3aa55e1559103 /gcc/cp | |
parent | 34fbe3f0946f88828765184ed6581bda62cdf49f (diff) | |
download | gcc-5c04da88731961636d08c0fd06f2aa291410d5b9.zip gcc-5c04da88731961636d08c0fd06f2aa291410d5b9.tar.gz gcc-5c04da88731961636d08c0fd06f2aa291410d5b9.tar.bz2 |
PR c++/92271 - make __is_same alias for __is_same_as.
Richard Smith proposed adding a synonym for __is_same_as, to accomodate the
convention of exposing std::SOME_TRAIT<A, B>::value as __SOME_TRAIT(A, B).
So add that alias, and also adjust the C++ printer. I didn't bother changing
the RID_ identifier.
* c-common.c: Add __is_same, an alias for __is_same_as.
* cxx-pretty-print.c (pp_cxx_trait_expression) <case CPTK_IS_SAME_AS>:
Print "__is_same".
* g++.dg/ext/is_same.C: New test.
From-SVN: r279018
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cxx-pretty-print.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b9b8949..4e88ed8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-12-05 Marek Polacek <polacek@redhat.com> + + PR c++/92271 - make __is_same alias for __is_same_as. + * cxx-pretty-print.c (pp_cxx_trait_expression) <case CPTK_IS_SAME_AS>: + Print "__is_same". + 2019-12-05 David Edelsohn <dje.gcc@gmail.com> * cp-gimplify.c: Include memmodel.h. diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 909b2a4e..6280544 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -2661,7 +2661,7 @@ pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t) pp_cxx_ws_string (pp, "__is_polymorphic"); break; case CPTK_IS_SAME_AS: - pp_cxx_ws_string (pp, "__is_same_as"); + pp_cxx_ws_string (pp, "__is_same"); break; case CPTK_IS_STD_LAYOUT: pp_cxx_ws_string (pp, "__is_std_layout"); |