This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C/C++ PATCH to add __typeof_noqual (PR c/65455, c/39985)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Fri, 23 Jun 2017 16:27:47 +0000
- Subject: Re: C/C++ PATCH to add __typeof_noqual (PR c/65455, c/39985)
- Authentication-results: sourceware.org; auth=none
- References: <20170623144606.GB4341@redhat.com>
On Fri, 23 Jun 2017, Marek Polacek wrote:
> You'll also see that I dropped all qualifiers for __auto_type. But I actually
> couldn't trigger the
> init_type = c_build_qualified_type (init_type, TYPE_UNQUALIFIED);
> line in c_parser_declaration_or_fndef (even when running the whole testsuite)
> so I'm not convinced it makes any difference.
It looks like it would only make a difference, in the present code, for
the case of an atomic register variable, or bit-field in an atomic
structure, as the initializer. Those are the cases where
convert_lvalue_to_rvalue would not return a non-atomic result, given an
atomic argument. With the proposed change, it should apply to any
qualified lvalue used as the initializer.
> @@ -506,6 +508,7 @@ const struct c_common_resword c_common_reswords[] =
> { "typename", RID_TYPENAME, D_CXXONLY | D_CXXWARN },
> { "typeid", RID_TYPEID, D_CXXONLY | D_CXXWARN },
> { "typeof", RID_TYPEOF, D_ASM | D_EXT },
> + { "typeof_noqual", RID_TYPEOF_NOQUAL, D_ASM | D_EXT },
> { "union", RID_UNION, 0 },
> { "unsigned", RID_UNSIGNED, 0 },
> { "using", RID_USING, D_CXXONLY | D_CXXWARN },
I don't think we should have this keyword variant.
I think there should be tests of the change to __auto_type.
--
Joseph S. Myers
joseph@codesourcery.com