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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to