diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-02-13 20:11:35 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-02-13 20:11:35 +0000 |
commit | 41dffe622d75043716fa6aaea7bba387751d7441 (patch) | |
tree | 0203969aadadf5624994ab772a5d5415a8c1d75f /gcc/testsuite | |
parent | 1daa84b6e2fee1548afaabb0d99fc797f1aa0f1c (diff) | |
download | gcc-41dffe622d75043716fa6aaea7bba387751d7441.zip gcc-41dffe622d75043716fa6aaea7bba387751d7441.tar.gz gcc-41dffe622d75043716fa6aaea7bba387751d7441.tar.bz2 |
re PR c++/14083 (ICE in conditional expression operator with throw)
PR c++/14083
* call.c (build_conditional_expr): Call force_rvalue on the
non-void operand in the case that one result is a throw-expression
and the other is not.
PR c++/14083
* g++.dg/eh/cond2.C: New test.
From-SVN: r77768
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/eh/cond2.C | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc197d4..dd13664 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-02-13 Mark Mitchell <mark@codesourcery.com> + + PR c++/14083 + * g++.dg/eh/cond2.C: New test. + 2004-02-12 Alan Modra <amodra@bigpond.net.au> * gcc.dg/debug/20020327-1.c: Disable for powerpc64. diff --git a/gcc/testsuite/g++.dg/eh/cond2.C b/gcc/testsuite/g++.dg/eh/cond2.C new file mode 100644 index 0000000..e4b45f7 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/cond2.C @@ -0,0 +1,19 @@ +// PR c++/14083 + +struct A { + A() throw() { } + A(const A&) throw() { } +}; + +struct X { + A a; + X(); + X& operator=(const X& __str); +}; + +bool operator==(const X& __lhs, const char* __rhs); + +int main() { + X x; + x=="" ? x : throw 1; +} |