This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50835] [4.7 Regression] Lvalue-ness of conditional operator results is incorrect in a function template
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 23 Oct 2011 11:47:19 +0000
- Subject: [Bug c++/50835] [4.7 Regression] Lvalue-ness of conditional operator results is incorrect in a function template
- Auto-submitted: auto-generated
- References: <bug-50835-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50835
--- Comment #1 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2011-10-23 11:47:19 UTC ---
Simplified test case:
//---
template<typename>
struct vector {};
template<typename T>
struct rvalue_probe
{
explicit rvalue_probe(T &t) : value(t) {}
operator T&() const { return value; }
T& value;
};
template <typename T>
void should_be_lvalue(T&)
{
}
template <typename>
void f()
{
vector<int> v;
should_be_lvalue(true ? rvalue_probe<vector<int> >(v) : v); // Error
}
//---
The problem exists in C++0x mode as well.