[llvm-bugs] [Bug 40150] New: deleted friend of template class conflicts with its own definition

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 24 12:05:13 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=40150

            Bug ID: 40150
           Summary: deleted friend of template class conflicts with its
                    own definition
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Casey at Carter.net
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

This correct TU:

    template<class>
    struct S {
        friend void operator|(int, const S&) = delete;
    };

    S<void> s;

is rejected by "clang++ -std=c++2a" (https://godbolt.org/z/Du4mGf) with
diagnostics:

    <source>:3:17: error: redefinition of 'operator|'
        friend void operator|(int, const S&) = delete;
                    ^
    <source>:6:9: note: in instantiation of template class 'S<void>' requested
here
    S<void> s;
            ^
    <source>:3:17: note: previous definition is here
        friend void operator|(int, const S&) = delete;
                    ^
    1 error generated.

-- 
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/20181224/39a27df0/attachment.html>


More information about the llvm-bugs mailing list