Bug ID: 36374
           Summary: redifinition of friend function doesn't result in
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++

template <typename Derived>
struct A {
  friend Derived operator+(const Derived& a, const Derived& b) {
    return Derived(a, b);

struct B : A<B> {
  B() = default;
  B(B, B) {}

  friend B operator+(const B& a, const B& b) { return B(a, b); }

void Foo() {
  B a, b, c = a + b;

The example above should not compile, as there are two definitions for the

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to