[cfe-commits] [patch][3.2] Visibility cleanup and fixes

Chandler Carruth chandlerc at google.com
Wed Apr 18 21:58:34 PDT 2012


On Wed, Apr 18, 2012 at 9:56 PM, John McCall <rjmccall at apple.com> wrote:

> On Apr 18, 2012, at 8:35 PM, Chandler Carruth wrote:
>
> On Wed, Apr 18, 2012 at 8:09 PM, Rafael EspĂ­ndola <
> rafael.espindola at gmail.com> wrote:
>
>> I have a small concern that if a users writes an explicit
>> attribute in a class member,  he will find it surprising when it gets
>> overwritten.
>>
>
> I'm not sufficiently well versed in visibility rules to really chime in on
> what the right model is, but there is a simple solution to this problem at
> least: add a warning about explicit member visibility attributes that get
> overridden?
>
>
> But all of the attributes here have an effect.  If you instantiated
> Rafael's template at a type with non-hidden visibility, e.g. int,
> the member's attribute still takes precedence.  The attribute is
> only "overridden" in the specific case of instantiating the
> template at a hidden argument.  I'm not convinced this is
> actually a problem that bears a warning, vs. something that
> we should defer to some hypothetical "explain everything that's
> happening with this symbol" IDE query.
>

Yea, I was thinking more of the case without the template as deserving a
warning.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120418/aca3e2ed/attachment.html>


More information about the cfe-commits mailing list