decltype(auto) deduced return type from lambda capture
问题 I have compilers disagreeing on a small C++14 code snippet: #include <cassert> struct unmovable { unmovable() {} unmovable(unmovable&&) = delete; }; int main() { unmovable u; auto i = [&]() -> decltype(auto) { return u; }; auto& uu = i(); assert(&uu == &u); } The program is accepted by g++4.9.3, g++-5.1.0, g++-5.2.0 and VisualStudio 2015, but not by clang++-3.7. clang++-3.7 deduces the return type to be unmovable (value) and not unmovable& . If the program is changed slightly, so that the