This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71154] Attributes for an explicit template instantiation are ignored


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71154

--- Comment #3 from James Abbatiello <abbeyj+gcc at gmail dot com> ---
Andrew Pinsky, I'm not sure I understand your comment.  Why would the
visibility of D be affected by the visibility of C<int>?  If I change your test
case so that C<int> is declared as hidden before the definition of D then I get
this warning:

warning: ‘D’ declared with greater visibility than the type of its field ‘D::a’
[-Wattributes]

But it is just a warning and it does not cause D to have hidden visibility. 
Did you have some different test in mind?

I've also tried your testcase with clang++ and it acts as I would expect (D is
visible, C<int> is hidden).  So it seems that it is possible to support this
behavior even if it might be difficult within g++ for some reason.

Can you please unresolve this bug?  Limit it just the visibility attribute if
you need to but I still want this change.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]