This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71154] Attributes for an explicit template instantiation are ignored
- From: "abbeyj+gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Jul 2016 05:42:54 +0000
- Subject: [Bug c++/71154] Attributes for an explicit template instantiation are ignored
- Auto-submitted: auto-generated
- References: <bug-71154-4@http.gcc.gnu.org/bugzilla/>
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.