Segfault when parsing an empty extern "C" {} block (#110)

extern declaration blocks can be empty: https://en.cppreference.com/w/cpp/language/language_linkage
This commit is contained in:
Julian Rüth 2021-02-03 19:28:49 +01:00 committed by GitHub
commit 36b64d29b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -36,6 +36,10 @@ extern "C++" // yup
enum e {};
}
/// extern "C++"{
/// }
extern "C++" {}
enum f {};
)";
@ -50,7 +54,7 @@ enum f {};
else
REQUIRE(false);
});
REQUIRE(count == 2u);
REQUIRE(count == 3u);
// check enums for their correct parent
count = test_visit<cpp_enum>(*file,