From 396f901d583982a30f0a67f91501be17edfc7de4 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 12 Feb 2021 14:49:31 -0800 Subject: [PATCH] Add test coverage for GH-1603 (default_initializable) (#1604) --- tests/std/tests/P0898R3_concepts/test.cpp | 35 +++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/tests/std/tests/P0898R3_concepts/test.cpp b/tests/std/tests/P0898R3_concepts/test.cpp index 4ae135c53..a0d79d601 100644 --- a/tests/std/tests/P0898R3_concepts/test.cpp +++ b/tests/std/tests/P0898R3_concepts/test.cpp @@ -150,6 +150,10 @@ struct ExplicitDefault { explicit ExplicitDefault() = default; }; +struct AggregatesExplicitDefault { + ExplicitDefault meow; +}; + struct DeletedDefault { DeletedDefault() = delete; }; @@ -1488,17 +1492,17 @@ namespace test_default_initializable { using std::default_initializable, std::initializer_list; STATIC_ASSERT(default_initializable); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1084668 +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-952724 STATIC_ASSERT(!default_initializable); -#else // ^^^ no workaround / workaround vvv +#else // ^^^ no workaround / assert bug so we'll notice when it's fixed vvv STATIC_ASSERT(default_initializable); -#endif // TRANSITION, VSO-1084668 +#endif // TRANSITION, DevCom-952724 STATIC_ASSERT(default_initializable); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1084668 +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-952724 STATIC_ASSERT(!default_initializable); -#else // ^^^ no workaround / workaround vvv +#else // ^^^ no workaround / assert bug so we'll notice when it's fixed vvv STATIC_ASSERT(default_initializable); -#endif // TRANSITION, VSO-1084668 +#endif // TRANSITION, DevCom-952724 STATIC_ASSERT(default_initializable); STATIC_ASSERT(!default_initializable); @@ -1511,11 +1515,11 @@ namespace test_default_initializable { STATIC_ASSERT(!default_initializable); STATIC_ASSERT(!default_initializable); STATIC_ASSERT(!default_initializable); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1084668 +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-952724 STATIC_ASSERT(!default_initializable); -#else // ^^^ no workaround / workaround vvv +#else // ^^^ no workaround / assert bug so we'll notice when it's fixed vvv STATIC_ASSERT(default_initializable); -#endif // TRANSITION, VSO-1084668 +#endif // TRANSITION, DevCom-952724 STATIC_ASSERT(!default_initializable); STATIC_ASSERT(!default_initializable); @@ -1559,11 +1563,18 @@ namespace test_default_initializable { int x; }; STATIC_ASSERT(default_initializable); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1084668 +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-952724 STATIC_ASSERT(!default_initializable); -#else // ^^^ no workaround / workaround vvv +#else // ^^^ no workaround / assert bug so we'll notice when it's fixed vvv STATIC_ASSERT(default_initializable); -#endif // TRANSITION, VSO-1084668 +#endif // TRANSITION, DevCom-952724 + + // Also test GH-1603 "default_initializable accepts types that are not default-initializable" +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-1326684 + STATIC_ASSERT(!default_initializable); +#else // ^^^ no workaround / assert bug so we'll notice when it's fixed vvv + STATIC_ASSERT(default_initializable); +#endif // TRANSITION, DevCom-1326684 } // namespace test_default_initializable namespace test_move_constructible {