[LLVMbugs] [Bug 6952] New: Clang allows redefinition of namespace-scope function via friend instantiation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 27 07:30:56 PDT 2010


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

           Summary: Clang allows redefinition of namespace-scope function
                    via friend instantiation
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
            Blocks: 6023


Created an attachment (id=4744)
 --> (http://llvm.org/bugs/attachment.cgi?id=4744)
Test case

We do not diagnose [temp.friend]p4, where a friend definition inside a class
template that is instantiated twice is a redefinition error. Instead, we just
see that the friend definition was instantiated and skip it.

The attached test case attempts to illustrate the intended behavior for C++98
and C++0x (there were changes in [temp.friend]p4). Clang type-checks it without
complain.

Boost.Units relies on this check for some of its static type safety.

-- 
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