This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PING: C++0x decltype patch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]