Since handle_visibility_attribute as its very first action checks
decl_function_context (decl) != 0, and since the visibility attribute of the
function template does not get inherited to its static variables, there is no
way to actually limit the visibility of these static variables.
This in turn prevents on IA64 that the variable be accessed without going
through the linkage table at all (i.e. even saving the pointless instruction
resulting from the linker conversion of ltoff22x/ldxmov).
Along with that, it might even lead to ill behavior since the containing
function instances can't be overridden by identically named ones in a different
load module, but the static variables (being weak, but not visibility
restricted) can.

-- 
           Summary: cannot change visibility of static variable in function
                    template
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jbeulich at novell dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: ia64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19238

Reply via email to