aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-11-21 22:16:02 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-11-21 22:16:02 +0000
commit40bec508967d0a1c5b053209fdb1e9aa0b600f65 (patch)
tree8002de9a5b616aaa19e5e5969272829ed34eea54 /gcc/cp/pt.c
parent0ba5c8a2be5c86b3e08a09e8a7ad0ee537f89075 (diff)
downloadgcc-40bec508967d0a1c5b053209fdb1e9aa0b600f65.zip
gcc-40bec508967d0a1c5b053209fdb1e9aa0b600f65.tar.gz
gcc-40bec508967d0a1c5b053209fdb1e9aa0b600f65.tar.bz2
re PR c++/12515 (Use of ?: operator in templated class causes ICE)
PR c++/12515 * pt.c (build_non_dependent_expr): Handle GNU extension to ?: operator. PR c++/12515 * g++.dg/ext/cond1.C: New test. From-SVN: r73820
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4afe974..5b96938 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -11893,7 +11893,9 @@ build_non_dependent_expr (tree expr)
return build (COND_EXPR,
TREE_TYPE (expr),
TREE_OPERAND (expr, 0),
- build_non_dependent_expr (TREE_OPERAND (expr, 1)),
+ (TREE_OPERAND (expr, 1)
+ ? build_non_dependent_expr (TREE_OPERAND (expr, 1))
+ : build_non_dependent_expr (TREE_OPERAND (expr, 0))),
build_non_dependent_expr (TREE_OPERAND (expr, 2)));
if (TREE_CODE (expr) == COMPOUND_EXPR
&& !COMPOUND_EXPR_OVERLOADED (expr))