Skip to content

Commit

Permalink
Replace noLoc with fakeLoc to silence the clang assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Mar 13, 2024
1 parent b813c44 commit 20c252f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Differentiator/VisitorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ namespace clad {
CastKind CK = m_Sema.PrepareScalarCast(Zero, T);
return m_Sema.ImpCastExprToType(Zero.get(), T, CK).get();
}
return m_Sema.ActOnInitList(noLoc, {}, noLoc).get();
SourceLocation fakeLoc = utils::GetValidSLoc(m_Sema);
return m_Sema.ActOnInitList(fakeLoc, {}, fakeLoc).get();
}

std::pair<const clang::Expr*, llvm::SmallVector<const clang::Expr*, 4>>
Expand Down
1 change: 0 additions & 1 deletion test/Gradient/UserDefinedTypes.C
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// RUN: ./UserDefinedTypes.out | FileCheck -check-prefix=CHECK-EXEC %s
// RUN: %cladclang -Xclang -plugin-arg-clad -Xclang -enable-tbr %s -I%S/../../include -oUserDefinedTypes.out
// RUN: ./UserDefinedTypes.out | FileCheck -check-prefix=CHECK-EXEC %s
// XFAIL: asserts
// CHECK-NOT: {{.*error|warning|note:.*}}
// XFAIL: target={{i586.*}}
#include "clad/Differentiator/Differentiator.h"
Expand Down

0 comments on commit 20c252f

Please sign in to comment.