-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang] Add clang 18 support #824
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #824 +/- ##
==========================================
- Coverage 94.82% 94.77% -0.06%
==========================================
Files 49 49
Lines 7501 7499 -2
==========================================
- Hits 7113 7107 -6
- Misses 388 392 +4
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
return Ctx.getConstantArrayType(EltTy, ArySize, SizeExpr, ASM, IndexTypeQuals); | ||
// clang 18 clang::ArrayType::ArraySizeModifier became clang::ArraySizeModifier | ||
#if CLANG_VERSION_MAJOR < 18 | ||
static inline QualType getConstantArrayType(const ASTContext &Ctx, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unused function 'getConstantArrayType' [clang-diagnostic-unused-function]
static inline QualType getConstantArrayType(const ASTContext &Ctx,
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@vgvassilev It is now building clad with clang-18 but it doesn't pass all the tests. It says that it is expected that 2 will fail, but 5 tests fail. Which 2 are expected to fail? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some comments about Compatibility.h. It is good that some changes are made before we accept this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
//Clang 18 ArrayType::Normal -> ArraySizeModifier::Normal | ||
|
||
#if LLVM_VERSION_MAJOR < 18 | ||
const auto ArraySizeModifier_Normal = ArrayType::Normal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: reference to 'ArrayType' is ambiguous [clang-diagnostic-error]
const auto ArraySizeModifier_Normal = clang::ArrayType::Normal;
^
Additional context
llvm/include/clang/Sema/Sema.h:86: candidate found by name lookup is 'clang::ArrayType'
class ArrayType;
^
llvm/include/llvm/Frontend/OpenMP/OMPConstants.h:24: candidate found by name lookup is 'llvm::ArrayType'
class ArrayType;
^
//Clang 18 ETK_None -> ElaboratedTypeKeyword::None | ||
|
||
#if LLVM_VERSION_MAJOR < 18 | ||
const auto ElaboratedTypeKeyword_None ETK_None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: declaration of variable 'ElaboratedTypeKeyword_None' with deduced type 'const auto' requires an initializer [clang-diagnostic-error]
const auto ElaboratedTypeKeyword_None = ETK_None;
^
//Clang 18 ETK_None -> ElaboratedTypeKeyword::None | ||
|
||
#if LLVM_VERSION_MAJOR < 18 | ||
const auto ElaboratedTypeKeyword_None ETK_None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: expected ';' after top level declarator [clang-diagnostic-error]
const auto ElaboratedTypeKeyword_None ETK_None; | |
const auto ElaboratedTypeKeyword_None = ETK_None; |
lib/Differentiator/CladUtils.cpp
Outdated
@@ -166,7 +166,7 @@ namespace clad { | |||
utils::BuildNNS(semaRef, const_cast<clang::DeclContext*>(declContext), CSS); | |||
NestedNameSpecifier* NS = CSS.getScopeRep(); | |||
if (auto* Prefix = NS->getPrefix()) | |||
return C.getElaboratedType(ETK_None, Prefix, QT); | |||
return C.getElaboratedType(ElaboratedTypeKeyword_None, Prefix, QT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ElaboratedTypeKeyword_None' [clang-diagnostic-error]
return C.getElaboratedType(clad_compat::ElaboratedTypeKeyword_None, Prefix, QT);
^
lib/Differentiator/CladUtils.cpp
Outdated
@@ -273,7 +273,7 @@ | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ArrayType_Normal' [clang-diagnostic-error]
/*ASM=*/clad_compat::ArraySizeModifier_Normal,
^
lib/Differentiator/CladUtils.cpp
Outdated
@@ -273,7 +273,7 @@ | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, | |||
/*IndexTypeQuals*/ 0); | |||
StringLiteral* SL = StringLiteral::Create(C, str, | |||
/*Kind=*/clad_compat::StringKind_Ordinary, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no member named 'StringKind_Ordinary' in namespace 'clad_compat' [clang-diagnostic-error]
/*Kind=*/clad_compat::StringLiteralKind_Ordinary,
^
@@ -41,7 +41,7 @@ namespace clad { | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ArrayType_Normal' [clang-diagnostic-error]
/*ASM=*/clad_compat::ArraySizeModifier_Normal,
^
@@ -41,7 +41,7 @@ | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, | |||
/*IndexTypeQuals*/ 0); | |||
const StringLiteral* SL = | |||
StringLiteral::Create(C, str, /*Kind=*/clad_compat::StringKind_Ordinary, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no member named 'StringKind_Ordinary' in namespace 'clad_compat' [clang-diagnostic-error]
StringLiteral::Create(C, str, /*Kind=*/clad_compat::StringLiteralKind_Ordinary,
^
lib/Differentiator/VisitorBase.cpp
Outdated
@@ -452,7 +452,7 @@ namespace clad { | |||
|
|||
// Create elaborated type with namespace specifier, | |||
// i.e. class<T> -> clad::class<T> | |||
return m_Context.getElaboratedType(ETK_None, NS, TT); | |||
return m_Context.getElaboratedType(ElaboratedTypeKeyword_None, NS, TT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ElaboratedTypeKeyword_None' [clang-diagnostic-error]
return m_Context.getElaboratedType(clad_compat::ElaboratedTypeKeyword_None, NS, TT);
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
lib/Differentiator/CladUtils.cpp
Outdated
@@ -166,7 +166,7 @@ namespace clad { | |||
utils::BuildNNS(semaRef, const_cast<clang::DeclContext*>(declContext), CSS); | |||
NestedNameSpecifier* NS = CSS.getScopeRep(); | |||
if (auto* Prefix = NS->getPrefix()) | |||
return C.getElaboratedType(ETK_None, Prefix, QT); | |||
return C.getElaboratedType(ElaboratedTypeKeyword_None, Prefix, QT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ElaboratedTypeKeyword_None'; did you mean 'clad_compat::ElaboratedTypeKeyword_None'? [clang-diagnostic-error]
return C.getElaboratedType(ElaboratedTypeKeyword_None, Prefix, QT); | |
return C.getElaboratedType(clad_compat::ElaboratedTypeKeyword_None, Prefix, QT); |
Additional context
include/clad/Differentiator/Compatibility.h:100: 'clad_compat::ElaboratedTypeKeyword_None' declared here
const auto ElaboratedTypeKeyword_None = ETK_None;
^
lib/Differentiator/CladUtils.cpp
Outdated
@@ -273,7 +273,7 @@ | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ArrayType_Normal' [clang-diagnostic-error]
/*ASM=*/ArrayType_Normal,
^
lib/Differentiator/CladUtils.cpp
Outdated
@@ -273,7 +273,7 @@ | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, | |||
/*IndexTypeQuals*/ 0); | |||
StringLiteral* SL = StringLiteral::Create(C, str, | |||
/*Kind=*/clad_compat::StringKind_Ordinary, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no member named 'StringKind_Ordinary' in namespace 'clad_compat' [clang-diagnostic-error]
/*Kind=*/clad_compat::StringKind_Ordinary,
^
@@ -41,7 +41,7 @@ namespace clad { | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ArrayType_Normal' [clang-diagnostic-error]
/*ASM=*/ArrayType_Normal,
^
@@ -41,7 +41,7 @@ | |||
llvm::APInt(/*numBits=*/32, | |||
str.size() + 1), | |||
/*SizeExpr=*/nullptr, | |||
/*ASM=*/ArrayType::Normal, | |||
/*ASM=*/ArrayType_Normal, | |||
/*IndexTypeQuals*/ 0); | |||
const StringLiteral* SL = | |||
StringLiteral::Create(C, str, /*Kind=*/clad_compat::StringKind_Ordinary, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no member named 'StringKind_Ordinary' in namespace 'clad_compat' [clang-diagnostic-error]
StringLiteral::Create(C, str, /*Kind=*/clad_compat::StringKind_Ordinary,
^
lib/Differentiator/VisitorBase.cpp
Outdated
@@ -452,7 +452,7 @@ namespace clad { | |||
|
|||
// Create elaborated type with namespace specifier, | |||
// i.e. class<T> -> clad::class<T> | |||
return m_Context.getElaboratedType(ETK_None, NS, TT); | |||
return m_Context.getElaboratedType(ElaboratedTypeKeyword_None, NS, TT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'ElaboratedTypeKeyword_None'; did you mean 'clad_compat::ElaboratedTypeKeyword_None'? [clang-diagnostic-error]
return m_Context.getElaboratedType(ElaboratedTypeKeyword_None, NS, TT); | |
return m_Context.getElaboratedType(clad_compat::ElaboratedTypeKeyword_None, NS, TT); |
Additional context
include/clad/Differentiator/Compatibility.h:100: 'clad_compat::ElaboratedTypeKeyword_None' declared here
const auto ElaboratedTypeKeyword_None = ETK_None;
^
Co-Authored-By: Vassil Vassilev <[email protected]> Co-Authored-By: Alexander Penev <[email protected]>
Co-Authored-By: Vassil Vassilev <[email protected]> Co-Authored-By: Alexander Penev <[email protected]>
Co-Authored-By: Vassil Vassilev <[email protected]> Co-Authored-By: Alexander Penev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 11. Check the log or trigger a new build to see more.
#if CLANG_VERSION_MAJOR > 17 | ||
#define CLAD_COMPAT_CLANG17_ActOnLambdaExpr_getCurrentScope_ExtraParam(V) /**/ | ||
#else | ||
#define CLAD_COMPAT_CLANG17_ActOnLambdaExpr_getCurrentScope_ExtraParam(V) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function-like macro 'CLAD_COMPAT_CLANG17_ActOnLambdaExpr_getCurrentScope_ExtraParam' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define CLAD_COMPAT_CLANG17_ActOnLambdaExpr_getCurrentScope_ExtraParam(V) \
^
// FIXME: Knowndependent set to false temporarily until known value found for | ||
// initialisation. | ||
|
||
static inline Stmt* UnresolvedLookupExpr_Create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unused function 'UnresolvedLookupExpr_Create' [clang-diagnostic-unused-function]
static inline Stmt* UnresolvedLookupExpr_Create(
^
// clang 18 clang::ArrayType::ArraySizeModifier became clang::ArraySizeModifier | ||
#if CLANG_VERSION_MAJOR < 18 | ||
static inline QualType | ||
getConstantArrayType(const ASTContext& Ctx, QualType EltTy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unused function 'getConstantArrayType' [clang-diagnostic-unused-function]
getConstantArrayType(const ASTContext& Ctx, QualType EltTy,
^
{ \ | ||
return CLAD_COMPAT_CREATE(CLASS, CTORARGS); \ | ||
} | ||
#define DEFINE_CLONE_STMT_CO(CLASS, CTORARGS) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function-like macro 'DEFINE_CLONE_STMT_CO' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define DEFINE_CLONE_STMT_CO(CLASS, CTORARGS) \
^
return CLAD_COMPAT_CREATE(CLASS, CTORARGS); \ | ||
} | ||
#define DEFINE_CLONE_STMT_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | |
(Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
lib/Differentiator/StmtClone.cpp:30:
- }
+ })
return CLAD_COMPAT_CREATE(CLASS, CTORARGS); \ | ||
} | ||
#define DEFINE_CLONE_STMT_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | |
Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \ |
clad_compat::ExprSetDeps(result, Node); \ | ||
return result; \ | ||
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function-like macro 'DEFINE_CLONE_EXPR_CO' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \
^
return result; \ | ||
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | |
(Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
lib/Differentiator/StmtClone.cpp:53:
- }
+ })
return result; \ | ||
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | |
Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \ |
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | ||
CLASS* result = (CLASS::Create CTORARGS); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
CLASS* result = (CLASS::Create CTORARGS); \ | |
(CLASS)* result = (CLASS::Create CTORARGS); \ |
@vgvassilev @alexander-penev I have addressed your feedback. This PR is ready for further review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -419,7 +411,8 @@ | |||
return result; | |||
} | |||
|
|||
DEFINE_CLONE_STMT_CO(ReturnStmt, (CLAD_COMPAT_CLANG8_Ctx_ExtraParams Node->getReturnLoc(), Clone(Node->getRetValue()), 0)) | |||
DEFINE_CLONE_STMT_CO(ReturnStmt, | |||
(Ctx, Node->getReturnLoc(), Clone(Node->getRetValue()), 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
(Ctx, Node->getReturnLoc(), Clone(Node->getRetValue()), 0)) | |
(Ctx, Node->getReturnLoc(), Clone(Node->getRetValue()), nullptr)) |
66fcd80
to
7bc5303
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
#if CLANG_VERSION_MAJOR <= 8 | ||
#define CLAD_COMPAT_8_DECLARE_CLONE_FN(ValueStmt) /**/ | ||
#elif CLANG_VERSION_MAJOR > 8 | ||
#define CLAD_COMPAT_8_DECLARE_CLONE_FN(ValueStmt) DECLARE_CLONE_FN(ValueStmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function-like macro 'CLAD_COMPAT_8_DECLARE_CLONE_FN' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define CLAD_COMPAT_8_DECLARE_CLONE_FN(ValueStmt) DECLARE_CLONE_FN(ValueStmt)
^
lib/Differentiator/StmtClone.cpp
Outdated
return result; \ | ||
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \ | |
(Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \ |
lib/Differentiator/StmtClone.cpp:53:
- }
+ })
@@ -91,8 +88,7 @@ | |||
(Ctx, Node->getValue(), CloneType(Node->getType()), | |||
Node->getLocation())) | |||
DEFINE_CLONE_EXPR_CO(PredefinedExpr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: expected ';' after top level declarator [clang-diagnostic-error]
DEFINE_CLONE_EXPR_CO(PredefinedExpr,
^
Additional context
lib/Differentiator/StmtClone.cpp:49: expanded from macro 'DEFINE_CLONE_EXPR_CO'
Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \
^
@@ -91,8 +88,7 @@ | |||
(Ctx, Node->getValue(), CloneType(Node->getType()), | |||
Node->getLocation())) | |||
DEFINE_CLONE_EXPR_CO(PredefinedExpr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redefinition of 'VisitPredefinedExpr' as different kind of symbol [clang-diagnostic-error]
DEFINE_CLONE_EXPR_CO(PredefinedExpr,
^
expanded from here
@@ -91,8 +88,7 @@ | |||
(Ctx, Node->getValue(), CloneType(Node->getType()), | |||
Node->getLocation())) | |||
DEFINE_CLONE_EXPR_CO(PredefinedExpr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'Node' [clang-diagnostic-error]
DEFINE_CLONE_EXPR_CO(PredefinedExpr,
^
Additional context
lib/Differentiator/StmtClone.cpp:49: expanded from macro 'DEFINE_CLONE_EXPR_CO'
Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \
^
308de4a
to
ef79ecf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
lib/Differentiator/StmtClone.cpp
Outdated
return result; \ | ||
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro replacement list should be enclosed in parentheses [bugprone-macro-parentheses]
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | |
(Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
lib/Differentiator/StmtClone.cpp:53:
- }
+ })
lib/Differentiator/StmtClone.cpp
Outdated
return result; \ | ||
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | |
Stmt* StmtClone::Visit##CLASS((CLASS)* Node) { \ |
lib/Differentiator/StmtClone.cpp
Outdated
} | ||
#define DEFINE_CLONE_EXPR_CO(CLASS, CTORARGS) \ | ||
Stmt* StmtClone::Visit##CLASS(CLASS* Node) { \ | ||
CLASS* result = (CLASS::Create CTORARGS); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
CLASS* result = (CLASS::Create CTORARGS); \ | |
(CLASS)* result = (CLASS::Create CTORARGS); \ |
f7ca9f1
to
c892845
Compare
c892845
to
44a7a44
Compare
Thank you @mcbarton and @alexander-penev! |
The codecov and clang-format complaints are bogus. |
This PR will add support for clang 18
Fixes #805