summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-02 05:47:18 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-02 05:47:18 +0000
commit0b1ece0b9ef5aecb7e6c74d7c7f5b9d6636e63d8 (patch)
treed6ff29c0acb044467d8da305f300ded7914a30e3 /gcc/cp/pt.c
parenta5a3c3a182f906d240c7e51e9d34f38ebaa323ee (diff)
downloadgcc-0b1ece0b9ef5aecb7e6c74d7c7f5b9d6636e63d8.tar.gz
PR c++/14369
* pt.c (build_non_dependent_expr): Do not create a NON_DEPENDENT_EXPR for a THROW_EXPR. PR c++/14369 * g++.dg/template/cond4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8f9a7bdc4c4..7dbbdc082d7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -12113,6 +12113,13 @@ build_non_dependent_expr (tree expr)
reason to create a new node. */
if (TREE_CODE (expr) == INTEGER_CST || TREE_CODE (expr) == REAL_CST)
return expr;
+ /* Preserve THROW_EXPRs -- all throw-expressions have type "void".
+ There is at least one place where we want to know that a
+ particular expression is a throw-expression: when checking a ?:
+ expression, there are special rules if the second or third
+ argument is a throw-expresion. */
+ if (TREE_CODE (expr) == THROW_EXPR)
+ return expr;
if (TREE_CODE (expr) == COND_EXPR)
return build (COND_EXPR,