aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaConcept.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-11-27 09:13:28 -0800
committerGitHub <noreply@github.com>2024-11-27 09:13:28 -0800
commit1e3e199ed9f214594e358eb0c7892cdedc703f7a (patch)
tree0f163d441f0132da378e14074f1f2383762b23ba /clang/lib/Sema/SemaConcept.cpp
parent2f02b5af6ecb973d3a7faad9b0daff22646e724d (diff)
downloadllvm-1e3e199ed9f214594e358eb0c7892cdedc703f7a.zip
llvm-1e3e199ed9f214594e358eb0c7892cdedc703f7a.tar.gz
llvm-1e3e199ed9f214594e358eb0c7892cdedc703f7a.tar.bz2
[Sema] Migrate away from PointerUnion::{is,get} (NFC) (#117498)
Note that PointerUnion::{is,get} have been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T> I'm not touching PointerUnion::dyn_cast for now because it's a bit complicated; we could blindly migrate it to dyn_cast_if_present, but we should probably use dyn_cast when the operand is known to be non-null.
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
-rw-r--r--clang/lib/Sema/SemaConcept.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 1bdf3a0..ff1df7b 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1384,8 +1384,7 @@ static void diagnoseUnsatisfiedConstraintExpr(
return;
}
- diagnoseWellFormedUnsatisfiedConstraintExpr(S,
- Record.template get<Expr *>(), First);
+ diagnoseWellFormedUnsatisfiedConstraintExpr(S, cast<Expr *>(Record), First);
}
void
@@ -1557,12 +1556,12 @@ NormalizedConstraint::NormalizedConstraint(ASTContext &C,
NormalizedConstraint &NormalizedConstraint::getLHS() const {
assert(isCompound() && "getLHS called on a non-compound constraint.");
- return Constraint.get<CompoundConstraint>().getPointer()->LHS;
+ return cast<CompoundConstraint>(Constraint).getPointer()->LHS;
}
NormalizedConstraint &NormalizedConstraint::getRHS() const {
assert(isCompound() && "getRHS called on a non-compound constraint.");
- return Constraint.get<CompoundConstraint>().getPointer()->RHS;
+ return cast<CompoundConstraint>(Constraint).getPointer()->RHS;
}
std::optional<NormalizedConstraint>