This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50424] New: G++ doesn't notice possible throw from default argument


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]