Explorar o código

<rdar://problem/9073695> std::uncaught_exception() becomes true before evaluating the throw-expression rather than after

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@127499 91177308-0d34-0410-b5e6-96231b3b80d8
Nick Kledzik %!s(int64=14) %!d(string=hai) anos
pai
achega
770a3c5116

+ 10 - 1
test/language.support/support.exception/uncaught/uncaught_exception.pass.cpp

@@ -20,13 +20,22 @@ struct A
     }
 };
 
+struct B
+{
+	B()
+	{
+		// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475
+        assert(!std::uncaught_exception());
+	}
+};
+
 int main()
 {
     try
     {
         A a;
         assert(!std::uncaught_exception());
-        throw 1;
+        throw B();
     }
     catch (...)
     {