<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Richard Smith" <richard@metafoo.co.uk><br><b>To: </b>reviews+D25308+public+96c9b20dd11b91e3@reviews.llvm.org, "Hal Finkel" <hfinkel@anl.gov><br><b>Cc: </b>"Alex L" <arphaman@gmail.com>, "Reid Kleckner" <rnk@google.com>, "Aaron Ballman" <aaron.ballman@gmail.com>, "cfe-commits" <cfe-commits@lists.llvm.org><br><b>Sent: </b>Monday, October 10, 2016 2:16:13 PM<br><b>Subject: </b>Re: [PATCH] D25308: [Sema] Ignore transparent_union attributes in C++<br><br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 10, 2016 at 10:45 AM, Hal Finkel via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">hfinkel added a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D25308#566176" rel="noreferrer" target="_blank">https://reviews.llvm.org/D25308#566176</a>, @arphaman wrote:<br>
<br>
> The updated patch now makes clang warn every time it encounters this attribute in C++ mode. Would that be the desired behaviour?<br>
<br>
<br>
</span>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.)?</blockquote><div><br></div><div>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.</div></div></div></div>
</blockquote>Indeed. Also, GCC seems to have a regression test as well to verify that the attribute is ignored in C++ mode.<br><br>Thanks again,<br>Hal<br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>