Skip to content

Commit d4b920d

Browse files
committed
test: add tests and some notes
1 parent 5c32882 commit d4b920d

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

tests/test_expected/base_tests.cpp

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,37 @@ TEST_CASE("swap", "[swap]")
166166
CHECK(e2.value() == 1'337);
167167
}
168168

169-
TEST_CASE("brace constructed value", "[brace_constructed_value]")
169+
TEST_CASE("copy-list-initialization", "[copy-initialization]")
170170
{
171-
#if !defined(__GNUC__) // GCC bug
172-
expected<std::string, int> e {{}};
173-
CHECK(e);
171+
{
172+
expected<std::string, int> e = {};
173+
CHECK(e);
174+
}
175+
}
176+
177+
TEST_CASE("brace constructed value", "[brace-constructed-value]")
178+
{
179+
{ // non-void
180+
expected<int, int> e {{}};
181+
CHECK(e);
182+
}
183+
{ // std::string
184+
#if !defined(__GNUC__)
185+
// This case doesn't work and needs clarification:
186+
// * an implementation bug
187+
// + a GCC bug?
188+
// + a language bug?
189+
// + a MSVC bug?
190+
// see CWG-1228(NAD), CWG-2735(DR), CWG-2856(DR)
191+
// see https://github.com/cplusplus/CWG/issues/486
192+
// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59389
193+
// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60027
194+
// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109247
195+
// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113300
196+
expected<std::string, int> e {{}};
197+
CHECK(e);
174198
#endif
199+
}
175200
}
176201

177202
TEST_CASE("LWG-3836", "[LWG-3836]")

0 commit comments

Comments
 (0)