re PR c++/52748 ([C++11] N3276 changes to decltype)
authorJason Merrill <jason@redhat.com>
Sun, 17 Mar 2013 02:37:09 +0000 (22:37 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 17 Mar 2013 02:37:09 +0000 (22:37 -0400)
commit57fcd4f4e4f12b1ede24f05385183d3f2dc7acfa
treec09183570e99438a8ee808eb03a342623d63c77f
parent2df663ccedf750ffe5ac481b3fe2aaff0d985a7f
re PR c++/52748 ([C++11] N3276 changes to decltype)

N3276
PR c++/52748
* cp-tree.h (tsubst_flags): Add tf_decltype.
* call.c (build_cxx_call): Don't build a temporary if it's set.
(build_over_call): Make sure it's only passed to build_cxx_call.
* parser.c (cp_parser_primary_expression): Add decltype_p parm.
(cp_parser_unary_expression): Likewise.
(cp_parser_cast_expression): Likewise.
(cp_parser_binary_expression): Likewise.
(cp_parser_assignment_expression): Likewise.
(cp_parser_postfix_expression): Likewise.  Pass tf_decltype.
(cp_parser_explicit_instantiation): Add decltype_p.  Force a
temporary for a call on the LHS of a comma.
(cp_parser_decltype): Pass true to decltype_p parms.
* pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
(tsubst_copy_and_build): Pass tf_decltype down only for
CALL_EXPR and the RHS of COMPOUND_EXPR.
* tree.c (build_cplus_new): Call complete_type_or_maybe_complain.

From-SVN: r196736
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/tree.c
gcc/testsuite/g++.dg/cpp0x/decltype-call1.C [new file with mode: 0644]