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

            Bug ID: 35332
           Summary: reference binding and conversion operators to
                    reference types
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: kaball...@hotmail.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

The following snippet compiles successfully, rather than resulting in calls to
deleted functions:

    struct convf {
      float f = 0;
      operator float&() { return f; }
      operator float const&() const { return f; }
    };

    template <typename T>
    void lvbind(T&) {}
    template <typename T>
    void lvbind(T&&) = delete;

    int main() {
      convf f;
      convf const fc;

      // lvbind<int>(f); // error: no match
      // lvbind<int>(fc); // error: no match
      lvbind<int const>(f);
      lvbind<int const>(fc);
    }

This is related to the resolution of LWG2993.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to