[libcxx] r348850 - [libcxx] Fix test failure on GCC 4.9

Louis Dionne ldionne at apple.com
Tue Dec 11 07:27:10 PST 2018


Author: ldionne
Date: Tue Dec 11 07:27:10 2018
New Revision: 348850

URL: http://llvm.org/viewvc/llvm-project?rev=348850&view=rev
Log:
[libcxx] Fix test failure on GCC 4.9

GCC 4.9 seems to think that a constexpr default constructor implies
the constructor to be noexcept.

Modified:
    libcxx/trunk/test/libcxx/utilities/utility/pairs/pairs.pair/default.pass.cpp

Modified: libcxx/trunk/test/libcxx/utilities/utility/pairs/pairs.pair/default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/utilities/utility/pairs/pairs.pair/default.pass.cpp?rev=348850&r1=348849&r2=348850&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/utilities/utility/pairs/pairs.pair/default.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/utilities/utility/pairs/pairs.pair/default.pass.cpp Tue Dec 11 07:27:10 2018
@@ -18,12 +18,17 @@
 #include <utility>
 #include <type_traits>
 
-#include "archetypes.hpp"
 
+struct ThrowingDefault {
+  ThrowingDefault() { }
+};
+
+struct NonThrowingDefault {
+  NonThrowingDefault() noexcept { }
+};
 
 int main() {
-    using NonThrowingDefault = NonThrowingTypes::DefaultOnly;
-    using ThrowingDefault = NonTrivialTypes::DefaultOnly;
+
     static_assert(!std::is_nothrow_default_constructible<std::pair<ThrowingDefault, ThrowingDefault>>::value, "");
     static_assert(!std::is_nothrow_default_constructible<std::pair<NonThrowingDefault, ThrowingDefault>>::value, "");
     static_assert(!std::is_nothrow_default_constructible<std::pair<ThrowingDefault, NonThrowingDefault>>::value, "");




More information about the libcxx-commits mailing list