]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/12515 (Use of ?: operator in templated class causes ICE)
authorMark Mitchell <mark@codesourcery.com>
Fri, 21 Nov 2003 22:16:02 +0000 (22:16 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 21 Nov 2003 22:16:02 +0000 (22:16 +0000)
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

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/cond1.C [new file with mode: 0644]

index c54a982bc40c509b4c5d7e0c0d58fbb96392c84a..a27679f3b028b999fd360788cb99934e16d8db13 100644 (file)
@@ -1,3 +1,9 @@
+2003-11-21  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/12515
+       * pt.c (build_non_dependent_expr): Handle GNU extension to ?:
+       operator.
+
 2003-11-21  Jan Hubicka  <jh@suse.cz>
 
        * parser.c (cp_parser_postfix_expression): Initialize 's' to
index 4afe974616dbe2f02ff8bf81105cbd2116557d9b..5b969388a64e04d969bbb5d5fe5225a1410eaf8b 100644 (file)
@@ -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))
index d14e5ae1b98f4d23e796783537935741ad455b72..73ffd70498c1bbf5f11988cb492787327ebbe042 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-21  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/12515
+       * g++.dg/ext/cond1.C: New test.
+
 2003-11-20  Richard Henderson  <rth@redhat.com>
 
        * gcc.dg/20020201-2.c: Remove.
diff --git a/gcc/testsuite/g++.dg/ext/cond1.C b/gcc/testsuite/g++.dg/ext/cond1.C
new file mode 100644 (file)
index 0000000..ec34212
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/12515
+// { dg-do compile }
+// { dg-options "" }
+template<int> void foo() { 0 ?: 0; }