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

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 27 01:48:38 PDT 2019


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

            Bug ID: 41253
           Summary: Deleted non-template inline friend function in
                    template class causes redefinition error
           Product: clang
           Version: 8.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: o_kniemeyer at maxon.de
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

The following code

  template <typename> struct C
  {
    friend void Func(C) = delete;
  };

  C<int> test;

generates the error 

  <source>:3:14: error: redefinition of 'Func'
    friend void Func(C) = delete;
                ^
  <source>:6:8: note: in instantiation of template class 'C<int>' requested
here
    C<int> test;
           ^
  <source>:3:14: note: previous definition is here
    friend void Func(C) = delete;


This might have the same cause as bug 35012, but bug 35012 already appeared in
Clang 5.0, while this bug appeared in Clang 7.0.

-- 
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/20190327/e3ff00ac/attachment-0001.html>


More information about the llvm-bugs mailing list