From beccd6f6e66cbc2b43a50e9309d6547271b0276f Mon Sep 17 00:00:00 2001 From: Klemens Date: Wed, 10 May 2023 11:09:09 +0800 Subject: [PATCH] _Bool becomes `bool` Closes #32. --- source/api/AST/ASTVisitor.cpp | 5 +++++ test-files/old-tests/attributes_1.xml | 2 +- test-files/old-tests/explicit-conv-operator.xml | 8 ++++---- test-files/old-tests/explicit-deduct-guide.xml | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/source/api/AST/ASTVisitor.cpp b/source/api/AST/ASTVisitor.cpp index 6a7b1e382..1484424ba 100644 --- a/source/api/AST/ASTVisitor.cpp +++ b/source/api/AST/ASTVisitor.cpp @@ -251,6 +251,9 @@ getTypeInfoForType( QualType const& T) { TagDecl const* TD = getTagDeclForType(T); + if (T->isBuiltinType() + && (T->getAs()->getKind() == BuiltinType::Bool)) + return TypeInfo(Reference(EmptySID, "bool")); if(!TD) return TypeInfo(Reference(EmptySID, T.getAsString())); InfoType IT; @@ -275,6 +278,8 @@ parseParameters( // KRYSTIAN NOTE: call getOriginalType instead // of getType if we want to preserve top-level // cv-qualfiers/array types/function types + auto ti = getTypeInfoForType(P->getType()); + FieldTypeInfo& FieldInfo = I.Params.emplace_back( getTypeInfoForType(P->getType()), P->getNameAsString()); diff --git a/test-files/old-tests/attributes_1.xml b/test-files/old-tests/attributes_1.xml index 37ede8521..406f6cbe9 100644 --- a/test-files/old-tests/attributes_1.xml +++ b/test-files/old-tests/attributes_1.xml @@ -5,7 +5,7 @@ - + diff --git a/test-files/old-tests/explicit-conv-operator.xml b/test-files/old-tests/explicit-conv-operator.xml index 4d0f03048..0d1026a64 100644 --- a/test-files/old-tests/explicit-conv-operator.xml +++ b/test-files/old-tests/explicit-conv-operator.xml @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -23,7 +23,7 @@ - + @@ -32,7 +32,7 @@ - + diff --git a/test-files/old-tests/explicit-deduct-guide.xml b/test-files/old-tests/explicit-deduct-guide.xml index dd569b07f..688ec14f8 100644 --- a/test-files/old-tests/explicit-deduct-guide.xml +++ b/test-files/old-tests/explicit-deduct-guide.xml @@ -29,7 +29,7 @@ - +