https://bugs.llvm.org/show_bug.cgi?id=42214
Richard Smith <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Richard Smith <[email protected]> ---
> However, icc, gcc, and msvc all accept the code. non-const lvalue reference to
> type is actually allowed?
No, a non-const reference cannot be bound to a temporary -- clang is correct to
diagnose this. But the other implementations are correct too: because this
error occurs in a template, no diagnostic is required until the template is
actually instantiated.
If you add an instantiation:
void f() {
VariableList<int, float>().ConnectAllToAll();
}
then GCC and ICC also reject, and MSVC also rejects under /permissive-
(standard-conforming mode).
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs