Teach GetType and friends about typedef names.#885
Teach GetType and friends about typedef names.#885vgvassilev merged 1 commit intocompiler-research:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #885 +/- ##
==========================================
- Coverage 78.86% 78.86% -0.01%
==========================================
Files 11 11
Lines 4079 4083 +4
==========================================
+ Hits 3217 3220 +3
- Misses 862 863 +1
🚀 New features to boost your workflow:
|
041b5d2 to
4596cc3
Compare
| */ | ||
| return QualType(); | ||
| } | ||
| static std::optional<QualType> GetTypeInternal(Decl* D) { |
There was a problem hiding this comment.
warning: 'GetTypeInternal' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
| static std::optional<QualType> GetTypeInternal(Decl* D) { | |
| std::optional<QualType> GetTypeInternal(Decl* D) { |
| */ | ||
| return QualType(); | ||
| } | ||
| static std::optional<QualType> GetTypeInternal(Decl* D) { |
There was a problem hiding this comment.
warning: no header providing "std::optional" is directly included [misc-include-cleaner]
lib/CppInterOp/CppInterOp.cpp:52:
- #if CLANG_VERSION_MAJOR >= 20
+ #include <optional>
+ #if CLANG_VERSION_MAJOR >= 20| } | ||
|
|
||
| return (TCppType_t)0; | ||
| return GetTypeFromScope((Decl*)GetNamed(name, /*Within=*/nullptr)); |
There was a problem hiding this comment.
warning: argument name 'Within' in comment does not match parameter name 'parent' [bugprone-argument-comment]
return GetTypeFromScope((Decl*)GetNamed(name, /*Within=*/nullptr));
^Additional context
include/CppInterOp/CppInterOp.h:489: 'parent' declared here
TCppScope_t parent = nullptr);
^lib/CppInterOp/CppInterOp.cpp:779: actual callee ('GetNamed') is declared here
TCppScope_t GetNamed(const std::string& name,
^| } | ||
|
|
||
| return (TCppType_t)0; | ||
| return GetTypeFromScope((Decl*)GetNamed(name, /*Within=*/nullptr)); |
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
return GetTypeFromScope((Decl*)GetNamed(name, /*Within=*/nullptr));
^|
|
||
| if (auto* TD = dyn_cast<TypeDecl>(D)) | ||
| return getASTContext().getTypeDeclType(TD).getAsOpaquePtr(); | ||
| if (auto QT = GetTypeInternal((Decl*)klass)) |
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
if (auto QT = GetTypeInternal((Decl*)klass))
^|
|
||
| std::vector<Decl*> Decls; | ||
| GetAllTopLevelDecls(code, Decls); | ||
| auto Ty = Cpp::GetType("Type_t"); |
There was a problem hiding this comment.
warning: 'auto Ty' can be declared as 'auto *Ty' [llvm-qualified-auto]
| auto Ty = Cpp::GetType("Type_t"); | |
| auto *Ty = Cpp::GetType("Type_t"); |
No description provided.