This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50424] New: G++ doesn't notice possible throw from default argument
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Sep 2011 18:01:38 +0000
- Subject: [Bug c++/50424] New: G++ doesn't notice possible throw from default argument
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50424
Bug #: 50424
Summary: G++ doesn't notice possible throw from default
argument
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jason@gcc.gnu.org
This testcase ends up calling terminate because G++ doesn't notice that h() can
throw because of the f() default argument used in the call to g().
int f() { throw 1; }
void g( int = f() ) { }
void h() { g(); }
int main()
{
try { h(); } catch (int) { }
}
This issue also affects the implementation of C++11 non-static data member
initializers that I'm working on.