2007-11-29 Jakub Jelinek <jakub@redhat.com>
+ PR c++/34270
+ * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
+ in templates.
+ * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
+ Likewise.
+
PR c++/34267
PR c++/34268
* parser.c (cp_parser_decltype): Don't call finish_id_expression
2007-11-25 Richard Guenther <rguenther@suse.de>
- decl.c (poplevel): Use BLOCK_CHAIN.
+ * decl.c (poplevel): Use BLOCK_CHAIN.
2007-11-24 Ollie Wild <aaw@google.com>
break;
case COND_EXPR:
- op1_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 1),
+ op1_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 1)
+ ? TREE_OPERAND (ref, 1)
+ : TREE_OPERAND (ref, 0),
treat_class_rvalues_as_lvalues);
op2_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 2),
treat_class_rvalues_as_lvalues);
switch (TREE_CODE (exp))
{
case COND_EXPR:
- if (!is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1)))
+ if (!is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1)
+ ? TREE_OPERAND (exp, 1)
+ : TREE_OPERAND (exp, 0)))
return NULL_TREE;
return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 2));
2007-11-29 Jakub Jelinek <jakub@redhat.com>
+ PR c++/34270
+ * g++.dg/template/cond7.C: New test.
+
PR c++/34267
PR c++/34268
* g++.dg/cpp0x/decltype7.C: New test.
--- /dev/null
+// PR c++/34270
+// { dg-do compile }
+// { dg-options "" }
+
+void foo ()
+{
+ __typeof__ (0 ?: 0) x;
+ __decltype (0 ?: 0) y;
+}
+
+template<int> void bar ()
+{
+ __typeof__ (0 ?: 0) x;
+ __decltype (0 ?: 0) y;
+}