This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14369] New: errenous reject of well-formed code
- From: "gdr at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2004 18:36:15 -0000
- Subject: [Bug c++/14369] New: errenous reject of well-formed code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Current mainline rejects the following (I think GCC-3.4.x is affected as
well but I did not check).
struct A { };
template<class T>
struct X : A {
const A* bar() const
{ return this; }
const A& foo() const;
};
template<class T>
const A& X<T>::foo() const
{
const A* t = bar();
return *(t ? t : throw 0);
}
with the rather esoteric:
t.C: In member function `const A& X<T>::foo() const':
t.C:15: error: `#`throw_expr' not supported by dump_expr#<expression error>' has
type `void' and is not a throw-expression
The pretty-printing error is easily fixed, but that is not the main
point of the PR. This is reject valid and a regression from at least
GCC-3.3.x
--
Summary: errenous reject of well-formed code
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gdr at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14369