Discussion:
C++ PATCH for c++/63437 (C++14 return (x))
Jason Merrill
2014-10-09 18:01:28 UTC
Permalink
In C++14 mode the compiler turns (x) into static_cast<X&>(x) in order to
prevent decltype(auto) from treating it as plain x. But that also
messes with the magic for treating a local variable as an rvalue in a
return statement. So we need to mark the obfuscation as coming from (x)
so we can undo it in check_return_expr.

Tested x86_64-pc-linux-gnu, applying to trunk.

Loading...