PR c++/44996
* semantics.c (finish_decltype_type): Correct decltype
of parenthesized rvalue reference variable.
From-SVN: r162323
2010-07-19 Jason Merrill <jason@redhat.com>
+ PR c++/44996
+ * semantics.c (finish_decltype_type): Correct decltype
+ of parenthesized rvalue reference variable.
+
PR c++/44969
* tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
* pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
type = TYPE_MAIN_VARIANT (type);
else if (real_lvalue_p (expr))
{
- if (TREE_CODE (type) != REFERENCE_TYPE)
- type = build_reference_type (type);
+ if (TREE_CODE (type) != REFERENCE_TYPE
+ || TYPE_REF_IS_RVALUE (type))
+ type = build_reference_type (non_reference (type));
}
else
type = non_reference (type);
+2010-07-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/44996
+ * g++.dg/cpp0x/decltype23.C: New.
+
2010-07-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/42385
--- /dev/null
+// { dg-options -std=c++0x }
+
+int x, &&y = static_cast<int &&>(x);
+typedef decltype((y)) myInt; // `y' is a parenthesized id-expression of type int that is an lvalue
+typedef int &myInt;