[LLVMbugs] [Bug 5792] New: Dependence on anonymity should grant private linkage

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Dec 15 16:10:00 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=5792

           Summary: Dependence on anonymity should grant private linkage
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rjmccall at apple.com
                CC: llvmbugs at cs.uiuc.edu


The current implementation of anonymous namespaces gives private linkage to all
entities semantically contained in an anonymous namespace.  This is
conservative;  I claim we can extend this to all "anonymous" objects, where an
object is anonymous iff:

1) It is declared within an anonymous namespace.
2) It is declared static.
3) It is a class or function template specialization with an anonymous template
argument.
4) it is a function with an anonymous argument type.

The rules of C++ forbid such objects from being referenced outside the current
translation unit.

In fact, having them be non-private could theoretically cause spurious link
errors.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list