https://bugs.llvm.org/show_bug.cgi?id=35034
Bug ID: 35034
Summary: An R-value to L-value reference binding in a templated
constructor
Product: clang
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangb...@nondot.org
Reporter: poltavsky.alexa...@gmail.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
A really nasty bug:
template<typename T>
struct data {
template<typename U>
data( U && value ) : _value{ T( std::forward<U>( value ) ) } {}
T _value;
};
data< int& > d{ 10 }; //okay on Clang, not okay on GCC & MSVC
https://godbolt.org/g/TrgJCp
The initial intent for the code was to avoid strict init rules for uniform
initialization in a converting constructor.
--
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