[C++ PATCH] anon type names
authorNathan Sidwell <nathan@acm.org>
Fri, 18 Oct 2019 12:46:01 +0000 (12:46 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 18 Oct 2019 12:46:01 +0000 (12:46 +0000)
commit638ba8121dd2042469c4b0051539c6bb8d3a5845
tree35bd626800d5cc9548b6d6bddd2ca2dfdbb19c0c
parent7c929c9c611546f0e77753e90b652f7607d06484
[C++ PATCH] anon type names

https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01354.html
I noticed that we use a bitfield flag to note types with names for linkage
purposes:
  typedef struct {} foo;
but, we can infer this by comparing TYPE_STUB_DECL and TYPE_DECL of the
main variant.  It's only checked in two places -- the C++ parser
and the objective C++ encoder.
* cp-tree.h (struct lang_type): Remove was_anonymous.
(TYPE_WAS_UNNAMED): Implement by checking TYPE_DECL &
TYPE_STUB_DECL.
* decl.c (name_unnamed_type): Don't set TYPE_WAS_UNNAMED.

From-SVN: r277155
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c