Fix a few compiler warnings. - #651
Merged
Merged
Conversation
Fixes:
```
ClangSharp/ClangSharp/sources/libClangSharp/ClangSharp.cpp:165:28: warning: 'is' is deprecated: Use isa instead [-Wdeprecated-declarations]
165 | if (object.is<BlockDecl*>()) {
| ^
ClangSharp/artifacts/llvm/install/include/llvm/ADT/PointerUnion.h:152:15: note: 'is' has been explicitly marked deprecated here
152 | inline bool is() const {
| ^
ClangSharp/ClangSharp/sources/libClangSharp/ClangSharp.cpp:165:28: warning: 'is<clang::BlockDecl *>' is deprecated: Use isa instead [-Wdeprecated-declarations]
165 | if (object.is<BlockDecl*>()) {
| ^
ClangSharp/artifacts/llvm/install/include/llvm/ADT/PointerUnion.h:151:5: note: 'is<clang::BlockDecl *>' has been explicitly marked deprecated here
151 | [[deprecated("Use isa instead")]]
| ^
```
Fixes:
```
ClangSharp/ClangSharp/sources/libClangSharp/ClangSharp.cpp:166:48: warning: 'get' is deprecated: Use cast instead [-Wdeprecated-declarations]
166 | return MakeCXCursor(object.get<BlockDecl*>(), getCursorTU(C));
| ^
ClangSharp/artifacts/llvm/install/include/llvm/ADT/PointerUnion.h:161:12: note: 'get' has been explicitly marked deprecated here
161 | inline T get() const {
| ^
ClangSharp/ClangSharp/sources/libClangSharp/ClangSharp.cpp:166:48: warning: 'get<clang::BlockDecl *>' is deprecated: Use cast instead [-Wdeprecated-declarations]
166 | return MakeCXCursor(object.get<BlockDecl*>(), getCursorTU(C));
| ^
ClangSharp/artifacts/llvm/install/include/llvm/ADT/PointerUnion.h:160:5: note: 'get<clang::BlockDecl *>' has been explicitly marked deprecated here
160 | [[deprecated("Use cast instead")]]
| ^
ClangSharp/ClangSharp/sources/libClangSharp/ClangSharp.cpp:169:48: warning: 'get' is deprecated: Use cast instead [-Wdeprecated-declarations]
169 | return MakeCXCursor(object.get<CompoundLiteralExpr*>(), getCursorDecl(C), getCursorTU(C));
| ^
ClangSharp/artifacts/llvm/install/include/llvm/ADT/PointerUnion.h:161:12: note: 'get' has been explicitly marked deprecated here
161 | inline T get() const {
| ^
ClangSharp/ClangSharp/sources/libClangSharp/ClangSharp.cpp:169:48: warning: 'get<clang::CompoundLiteralExpr *>' is deprecated: Use cast instead [-Wdeprecated-declarations]
169 | return MakeCXCursor(object.get<CompoundLiteralExpr*>(), getCursorDecl(C), getCursorTU(C));
| ^
ClangSharp/artifacts/llvm/install/include/llvm/ADT/PointerUnion.h:160:5: note: 'get<clang::CompoundLiteralExpr *>' has been explicitly marked deprecated here
160 | [[deprecated("Use cast instead")]]
| ^
```
tannergooding
approved these changes
Nov 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use 'cast' instead of 'get'.
Fixes:
Use 'isa' instead of 'is'.
Fixes: