[clang] 3993de1 - [clang] Modernize EvalStatus (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 16 14:02:46 PDT 2023
Author: Kazu Hirata
Date: 2023-04-16T14:02:34-07:00
New Revision: 3993de129182c3e98a3ab009ed99ad00bc8eff6e
URL: https://github.com/llvm/llvm-project/commit/3993de129182c3e98a3ab009ed99ad00bc8eff6e
DIFF: https://github.com/llvm/llvm-project/commit/3993de129182c3e98a3ab009ed99ad00bc8eff6e.diff
LOG: [clang] Modernize EvalStatus (NFC)
Identified with modernize-use-default-member-init.
Added:
Modified:
clang/include/clang/AST/Expr.h
Removed:
################################################################################
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index e8f5b70f8f73..a9941d9e8af4 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -593,12 +593,12 @@ class Expr : public ValueStmt {
struct EvalStatus {
/// Whether the evaluated expression has side effects.
/// For example, (f() && 0) can be folded, but it still has side effects.
- bool HasSideEffects;
+ bool HasSideEffects = false;
/// Whether the evaluation hit undefined behavior.
/// For example, 1.0 / 0.0 can be folded to Inf, but has undefined behavior.
/// Likewise, INT_MAX + 1 can be folded to INT_MIN, but has UB.
- bool HasUndefinedBehavior;
+ bool HasUndefinedBehavior = false;
/// Diag - If this is non-null, it will be filled in with a stack of notes
/// indicating why evaluation failed (or why it failed to produce a constant
@@ -607,10 +607,9 @@ class Expr : public ValueStmt {
/// foldable. If the expression is foldable, but not a constant expression,
/// the notes will describes why it isn't a constant expression. If the
/// expression *is* a constant expression, no notes will be produced.
- SmallVectorImpl<PartialDiagnosticAt> *Diag;
+ SmallVectorImpl<PartialDiagnosticAt> *Diag = nullptr;
- EvalStatus()
- : HasSideEffects(false), HasUndefinedBehavior(false), Diag(nullptr) {}
+ EvalStatus() = default;
// hasSideEffects - Return true if the evaluated expression has
// side effects.
More information about the cfe-commits
mailing list