mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-09-19 19:19:05 +01:00
clangparser: mark incomplete arrays as incomplete without failing
Attempting to complete a type which can't be completed currently fails oilgen. For incomplete arrays, which we know are not possible to complete, return false deliberately. `requireCompleteType` likely needs to not fail in all cases in the future. For now this works. Test plan: - `std::unique_ptr<long[]>` used to fail the generation. Now it can successfully codegen.
This commit is contained in:
parent
c5ecb9aaa2
commit
beb404e41c
@ -410,8 +410,17 @@ ContainerInfo* ClangTypeParser::getContainerInfo(
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool requireCompleteType(clang::Sema& sema, const clang::Type& ty) {
|
bool requireCompleteType(clang::Sema& sema, const clang::Type& ty) {
|
||||||
|
switch (ty.getTypeClass()) {
|
||||||
|
case clang::Type::Builtin: {
|
||||||
if (ty.isSpecificBuiltinType(clang::BuiltinType::Void))
|
if (ty.isSpecificBuiltinType(clang::BuiltinType::Void))
|
||||||
return true; // treat as complete
|
return true; // treat as complete
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case clang::Type::IncompleteArray:
|
||||||
|
return false; // would fail completion
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This is a terrible warning.
|
// TODO: This is a terrible warning.
|
||||||
return !sema.RequireCompleteType(
|
return !sema.RequireCompleteType(
|
||||||
|
Loading…
Reference in New Issue
Block a user