[llvm-bugs] [Bug 35012] New: Deleted template inline friend function in template class causes redefinition error

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 20 09:37:30 PDT 2017


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

            Bug ID: 35012
           Summary: Deleted template inline friend function in template
                    class causes redefinition error
           Product: clang
           Version: 5.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: st at quanttec.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

When compiling the following code with `clang++ -std=c++17 Test.cpp`

  template <typename T>
  struct Test {
    template <typename U>
    friend bool operator==(Test, U) = delete;
  };
  Test<int> test;

I get the following unexpected error:

  > clang++ -std=c++17 Test.cpp 
  Test.cpp:4:15: error: redefinition of 'operator=='
    friend bool operator==(Test, U) = delete;
                ^
  Test.cpp:6:11: note: in instantiation of template class 'Test<int>' requested
here
  Test<int> test;
            ^
  Test.cpp:4:15: note: previous definition is here
    friend bool operator==(Test, U) = delete;
              ^
  1 error generated.

GCC 7.2 produces no error.

-- 
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/20171020/2a8bbfb7/attachment.html>


More information about the llvm-bugs mailing list