[LLVMbugs] [Bug 22307] New: Unassociated template may multiply define friend function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 23 02:34:24 PST 2015


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

            Bug ID: 22307
           Summary: Unassociated template may multiply define friend
                    function
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david_work at me.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Multiple definition of a function isn't diagnosed when all definitions are
specializations of the same template.

/* struct t isn't necessary to reproduce the bug,
   but it does help generate a neat segfault. */
struct t {
    friend int leak( t );
};

template< typename v >
struct m {
    friend int leak( t ) { return sizeof (v); }
};

template struct m< char >;
template struct m< short >;

int main() {
    leak( t() );
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150123/5cbbd4ab/attachment.html>


More information about the llvm-bugs mailing list