[clang] [Clang] Replace include with forward declaration (NFC) (PR #151292)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 30 01:39:39 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h -- clang/include/clang/AST/Expr.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 6c124aa96..4b49a0d50 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -59,50 +59,51 @@ namespace clang {
class ValueDecl;
class WarnUnusedResultAttr;
-/// A simple array of base specifiers.
-typedef SmallVector<CXXBaseSpecifier*, 4> CXXCastPath;
-
-/// An adjustment to be made to the temporary created when emitting a
-/// reference binding, which accesses a particular subobject of that temporary.
-struct SubobjectAdjustment {
- enum {
- DerivedToBaseAdjustment,
- FieldAdjustment,
- MemberPointerAdjustment
- } Kind;
-
- struct DTB {
- const CastExpr *BasePath;
- const CXXRecordDecl *DerivedClass;
- };
+ /// A simple array of base specifiers.
+ typedef SmallVector<CXXBaseSpecifier *, 4> CXXCastPath;
+
+ /// An adjustment to be made to the temporary created when emitting a
+ /// reference binding, which accesses a particular subobject of that
+ /// temporary.
+ struct SubobjectAdjustment {
+ enum {
+ DerivedToBaseAdjustment,
+ FieldAdjustment,
+ MemberPointerAdjustment
+ } Kind;
+
+ struct DTB {
+ const CastExpr *BasePath;
+ const CXXRecordDecl *DerivedClass;
+ };
- struct P {
- const MemberPointerType *MPT;
- Expr *RHS;
- };
+ struct P {
+ const MemberPointerType *MPT;
+ Expr *RHS;
+ };
- union {
- struct DTB DerivedToBase;
- const FieldDecl *Field;
- struct P Ptr;
- };
+ union {
+ struct DTB DerivedToBase;
+ const FieldDecl *Field;
+ struct P Ptr;
+ };
- SubobjectAdjustment(const CastExpr *BasePath,
- const CXXRecordDecl *DerivedClass)
- : Kind(DerivedToBaseAdjustment) {
- DerivedToBase.BasePath = BasePath;
- DerivedToBase.DerivedClass = DerivedClass;
- }
+ SubobjectAdjustment(const CastExpr *BasePath,
+ const CXXRecordDecl *DerivedClass)
+ : Kind(DerivedToBaseAdjustment) {
+ DerivedToBase.BasePath = BasePath;
+ DerivedToBase.DerivedClass = DerivedClass;
+ }
- SubobjectAdjustment(const FieldDecl *Field) : Kind(FieldAdjustment) {
- this->Field = Field;
- }
+ SubobjectAdjustment(const FieldDecl *Field) : Kind(FieldAdjustment) {
+ this->Field = Field;
+ }
- SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
- : Kind(MemberPointerAdjustment) {
- this->Ptr.MPT = MPT;
- this->Ptr.RHS = RHS;
- }
+ SubobjectAdjustment(const MemberPointerType *MPT, Expr *RHS)
+ : Kind(MemberPointerAdjustment) {
+ this->Ptr.MPT = MPT;
+ this->Ptr.RHS = RHS;
+ }
};
/// This represents one expression. Note that Expr's are subclasses of Stmt.
``````````
</details>
https://github.com/llvm/llvm-project/pull/151292
More information about the cfe-commits
mailing list