This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING: C++0x decltype patch
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Doug Gregor <doug dot gregor at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Jul 2007 19:48:19 +0100
- Subject: Re: PING: C++0x decltype patch
- References: <24b520d20707251228m32ccd1bcs6af46b72c0598238@mail.gmail.com>
Doug Gregor wrote:
It's been about two weeks since I submitted the latest decltype patch:
http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01058.html
Since then, decltype has been accepted into C++0x, in exactly the same
form as it is implemented in the patch.
Okay for mainline?
- Doug
Index: cp/semantics.c
+ case BIT_FIELD_REF:
+ sorry ("bit-field accesses in a decltype expression");
+ return error_mark_node;
+ default:
+ if (TYPE_P (expr) || DECL_P (expr))
+ error ("argument to decltype must be an expression");
+ else
+ sorry ("unhandled decltype expression kind: %s",
+ tree_code_name[(int) TREE_CODE (expr)]);
why sorry and not gcc_assert or gcc_unreachable?
+ if (TREE_CODE (expr) == CALL_EXPR
+ && (fndecl = get_callee_fndecl (expr))
+ && (fndecl != error_mark_node))
+ else if ((type = is_bitfield_expr_with_lowered_type (expr)))
ow :) can we avoid assignments in conditionals here?
Index: cp/parser.c
+static tree
+cp_parser_decltype (cp_parser *parser)
here you parse tentatively, but don't appear to be committing to the tentative
parse when it succeeds.
Also, I can't see where decltype is gated on using c++0x extensions
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk