re PR c++/34270 (ICE applying __decltype to ternary expression)
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. * g++.dg/template/cond7.C: New test. From-SVN: r130520
This commit is contained in:
parent
7a547b936c
commit
42924ed71f
@ -1,5 +1,11 @@
|
|||||||
2007-11-29 Jakub Jelinek <jakub@redhat.com>
|
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++/34267
|
||||||
PR c++/34268
|
PR c++/34268
|
||||||
* parser.c (cp_parser_decltype): Don't call finish_id_expression
|
* parser.c (cp_parser_decltype): Don't call finish_id_expression
|
||||||
@ -25,7 +31,7 @@
|
|||||||
|
|
||||||
2007-11-25 Richard Guenther <rguenther@suse.de>
|
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>
|
2007-11-24 Ollie Wild <aaw@google.com>
|
||||||
|
|
||||||
|
@ -160,7 +160,9 @@ lvalue_p_1 (const_tree ref,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case COND_EXPR:
|
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);
|
treat_class_rvalues_as_lvalues);
|
||||||
op2_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 2),
|
op2_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 2),
|
||||||
treat_class_rvalues_as_lvalues);
|
treat_class_rvalues_as_lvalues);
|
||||||
|
@ -1419,7 +1419,9 @@ is_bitfield_expr_with_lowered_type (const_tree exp)
|
|||||||
switch (TREE_CODE (exp))
|
switch (TREE_CODE (exp))
|
||||||
{
|
{
|
||||||
case COND_EXPR:
|
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 NULL_TREE;
|
||||||
return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 2));
|
return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 2));
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
2007-11-29 Jakub Jelinek <jakub@redhat.com>
|
2007-11-29 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/34270
|
||||||
|
* g++.dg/template/cond7.C: New test.
|
||||||
|
|
||||||
PR c++/34267
|
PR c++/34267
|
||||||
PR c++/34268
|
PR c++/34268
|
||||||
* g++.dg/cpp0x/decltype7.C: New test.
|
* g++.dg/cpp0x/decltype7.C: New test.
|
||||||
|
15
gcc/testsuite/g++.dg/template/cond7.C
Normal file
15
gcc/testsuite/g++.dg/template/cond7.C
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user