[PATCH] D25308: [Sema] Ignore transparent_union attributes in C++

Hal Finkel via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 10 12:22:24 PDT 2016


----- Original Message -----

> From: "Richard Smith" <richard at metafoo.co.uk>
> To: reviews+D25308+public+96c9b20dd11b91e3 at reviews.llvm.org, "Hal
> Finkel" <hfinkel at anl.gov>
> Cc: "Alex L" <arphaman at gmail.com>, "Reid Kleckner" <rnk at google.com>,
> "Aaron Ballman" <aaron.ballman at gmail.com>, "cfe-commits"
> <cfe-commits at lists.llvm.org>
> Sent: Monday, October 10, 2016 2:16:13 PM
> Subject: Re: [PATCH] D25308: [Sema] Ignore transparent_union
> attributes in C++

> On Mon, Oct 10, 2016 at 10:45 AM, Hal Finkel via cfe-commits <
> cfe-commits at lists.llvm.org > wrote:

> > hfinkel added a comment.
> 

> > In https://reviews.llvm.org/D25308#566176 , @arphaman wrote:
> 

> > > The updated patch now makes clang warn every time it encounters
> > > this attribute in C++ mode. Would that be the desired behaviour?
> 

> > As I understand it, transparent_union was designed for use in
> > system
> > headers, and these might certainly be included into C++ source
> > files. Does that not work correctly, or does the feature just not
> > work correctly when combined with C++-specific features (templates,
> > function overloading, etc.)?
> 
> Neither Clang nor GCC supports this attribute in C++ mode in any way,
> as far as I can see. All uses of this attribute within the glibc
> headers are behind #ifndef __cplusplus.
Indeed. Also, GCC seems to have a regression test as well to verify that the attribute is ignored in C++ mode. 

Thanks again, 
Hal 

-- 

Hal Finkel 
Lead, Compiler Technology and Programming Languages 
Leadership Computing Facility 
Argonne National Laboratory 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161010/58d22c22/attachment.html>


More information about the cfe-commits mailing list