Test to demonstrate compiler behavior change in Xcode 7 / clang 3.7.

mutable-v2
Andrew Twyman 2015-06-17 15:02:22 -07:00
parent 2aa22aab4b
commit 50ed8c90e5
1 changed files with 8 additions and 0 deletions

View File

@ -91,6 +91,14 @@ int main(int argc, char **argv) {
assert(uni[0].string_value().size() == (sizeof utf8) - 1);
assert(memcmp(uni[0].string_value().data(), utf8, sizeof utf8) == 0);
// Demonstrates the behavior change in Xcode 7 / Clang 3.7 described
// here: https://llvm.org/bugs/show_bug.cgi?id=23812
Json nested_array = Json::array { Json::array { 1, 2, 3 } };
assert(nested_array.is_array());
assert(nested_array.array_items().size() == 1);
assert(nested_array.array_items()[0].is_array());
assert(nested_array.array_items()[0].array_items().size() == 3);
Json my_json = Json::object {
{ "key1", "value1" },
{ "key2", false },