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 origin/main HEAD --extensions h,cpp --
clang/lib/Parse/ParseReflect.cpp
clang/test/Reflection/parsing-reflection.pass.cpp
clang/include/clang/AST/ExprCXX.h clang/include/clang/AST/RecursiveASTVisitor.h
clang/include/clang/Parse/Parser.h clang/include/clang/Sema/Sema.h
clang/include/clang/Serialization/ASTBitCodes.h clang/lib/AST/ExprCXX.cpp
clang/lib/AST/ExprClassification.cpp clang/lib/AST/ExprConstant.cpp
clang/lib/AST/StmtPrinter.cpp clang/lib/AST/StmtProfile.cpp
clang/lib/Lex/Lexer.cpp clang/lib/Parse/ParseExpr.cpp
clang/lib/Parse/ParseTentative.cpp clang/lib/Sema/SemaExceptionSpec.cpp
clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/TreeTransform.h
clang/lib/Serialization/ASTReaderStmt.cpp
clang/lib/Serialization/ASTWriterStmt.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/AST/ExprCXX.h
b/clang/include/clang/AST/ExprCXX.h
index 75eb02b06..80f02e40e 100644
--- a/clang/include/clang/AST/ExprCXX.h
+++ b/clang/include/clang/AST/ExprCXX.h
@@ -5513,14 +5513,13 @@ class CXXReflectExpr : public Expr {
CXXReflectExpr(EmptyShell Empty);
public:
-
static CXXReflectExpr *Create(ASTContext &C, SourceLocation OperatorLoc,
SourceLocation ArgLoc, QualType Operand);
static CXXReflectExpr *Create(ASTContext &C, SourceLocation OperatorLoc,
SourceLocation OperandLoc, Decl *Operand);
- static CXXReflectExpr *CreateEmpty(ASTContext& C);
+ static CXXReflectExpr *CreateEmpty(ASTContext &C);
SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; }
SourceLocation getEndLoc() const LLVM_READONLY {
diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h
b/clang/include/clang/AST/RecursiveASTVisitor.h
index 9cb7af5c8..77b801af8 100644
--- a/clang/include/clang/AST/RecursiveASTVisitor.h
+++ b/clang/include/clang/AST/RecursiveASTVisitor.h
@@ -2884,8 +2884,8 @@ DEF_TRAVERSE_STMT(CXXUnresolvedConstructExpr, {
})
DEF_TRAVERSE_STMT(CXXReflectExpr, {
- // TODO
-})
+ // TODO
+ })
// These expressions all might take explicit template arguments.
// We traverse those if so. FIXME: implement these.
diff --git a/clang/include/clang/Parse/Parser.h
b/clang/include/clang/Parse/Parser.h
index dc477141a..91c25db30 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -5168,10 +5168,9 @@ private:
/// Implementations are in ParseHLSL.cpp
///@{
-
-
//===--------------------------------------------------------------------===//
- // C++2c: Reflection [P2996]
- ExprResult ParseCXXReflectExpression(SourceLocation OpLoc);
+
//===--------------------------------------------------------------------===//
+ // C++2c: Reflection [P2996]
+ ExprResult ParseCXXReflectExpression(SourceLocation OpLoc);
private:
bool MaybeParseHLSLAnnotations(Declarator &D,
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 26241bdc4..ae9f72351 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -14753,15 +14753,14 @@ public:
///@{
public:
+ ExprResult ActOnCXXReflectExpr(SourceLocation OpLoc, TypeSourceInfo *T);
+ ExprResult ActOnCXXReflectExpr(SourceLocation OpLoc, SourceLocation ArgLoc,
+ Decl *D);
- ExprResult ActOnCXXReflectExpr(SourceLocation OpLoc, TypeSourceInfo* T);
- ExprResult ActOnCXXReflectExpr(SourceLocation OpLoc,
- SourceLocation ArgLoc, Decl *D);
-
- ExprResult BuildCXXReflectExpr(SourceLocation OperatorLoc,
+ ExprResult BuildCXXReflectExpr(SourceLocation OperatorLoc,
SourceLocation OperandLoc, QualType T);
- ExprResult BuildCXXReflectExpr(SourceLocation OperatorLoc,
- SourceLocation OperandLoc, Decl *D);
+ ExprResult BuildCXXReflectExpr(SourceLocation OperatorLoc,
+ SourceLocation OperandLoc, Decl *D);
public:
void PushSatisfactionStackEntry(const NamedDecl *D,
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index 5ecfaf847..77fc48c41 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -1940,16 +1940,19 @@ TypeTraitExpr *TypeTraitExpr::CreateDeserialized(const
ASTContext &C,
}
CXXReflectExpr::CXXReflectExpr(const ASTContext &C, QualType T, QualType Ty)
-: Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
+ : Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
-CXXReflectExpr::CXXReflectExpr(const ASTContext &C, QualType T, Decl *Arg,
bool IsNamespace)
-: Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
+CXXReflectExpr::CXXReflectExpr(const ASTContext &C, QualType T, Decl *Arg,
+ bool IsNamespace)
+ : Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
CXXReflectExpr::CXXReflectExpr(EmptyShell Empty)
-: Expr(CXXReflectExprClass, Empty) {}
+ : Expr(CXXReflectExprClass, Empty) {}
-CXXReflectExpr *CXXReflectExpr::Create(ASTContext &C, SourceLocation
OperatorLoc,
- SourceLocation OperandLoc, QualType Operand) {
+CXXReflectExpr *CXXReflectExpr::Create(ASTContext &C,
+ SourceLocation OperatorLoc,
+ SourceLocation OperandLoc,
+ QualType Operand) {
CXXReflectExpr *E = new (C) CXXReflectExpr(C, C.DependentTy, Operand);
E->setOperatorLoc(OperatorLoc);
E->setOperandRange(OperandLoc);
@@ -1962,8 +1965,8 @@ CXXReflectExpr *CXXReflectExpr::Create(ASTContext &C,
Decl *Operand) {
bool IsNamespace = isa<TranslationUnitDecl>(Operand);
- CXXReflectExpr *E = new (C) CXXReflectExpr(C, C.DependentTy, Operand,
- IsNamespace);
+ CXXReflectExpr *E =
+ new (C) CXXReflectExpr(C, C.DependentTy, Operand, IsNamespace);
E->setOperatorLoc(OperatorLoc);
E->setOperandRange(OperandLoc);
return E;
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index fea0def4b..94fcc85d3 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -2566,7 +2566,6 @@ void StmtPrinter::VisitCXXUnresolvedConstructExpr(
OS << ')';
}
-
void StmtPrinter::VisitCXXReflectExpr(CXXReflectExpr *S) {
// TODO: Make this better.
OS << "^(...)";
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index c7c25c317..80af51d4f 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -2169,7 +2169,7 @@ StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) {
void StmtProfiler::VisitCXXReflectExpr(const CXXReflectExpr *E) {
VisitExpr(E);
- // TODO:
+ // TODO:
}
void
diff --git a/clang/lib/Parse/ParseReflect.cpp b/clang/lib/Parse/ParseReflect.cpp
index 817c885ab..8a8529d42 100644
--- a/clang/lib/Parse/ParseReflect.cpp
+++ b/clang/lib/Parse/ParseReflect.cpp
@@ -1,7 +1,5 @@
-
-
#include "clang/AST/LocInfoType.h"
#include "clang/Basic/DiagnosticParse.h"
#include "clang/Parse/Parser.h"
@@ -29,7 +27,7 @@ ExprResult Parser::ParseCXXReflectExpression(SourceLocation
OpLoc) {
TentativeParsingAction TPA(*this);
if (SS.isValid() &&
- SS.getScopeRep().getKind() ==
NestedNameSpecifier::Kind::Global) {
+ SS.getScopeRep().getKind() == NestedNameSpecifier::Kind::Global) {
// Check for global namespace '^^::'
TPA.Commit();
Decl *TUDecl = Actions.getASTContext().getTranslationUnitDecl();
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index db5306794..ffd596e57 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -17783,8 +17783,10 @@ void Sema::PushExpressionEvaluationContextForFunction(
}
}
-ExprResult Sema::ActOnCXXReflectExpr(SourceLocation OpLoc, TypeSourceInfo*
TSI) {
- return BuildCXXReflectExpr(OpLoc, TSI->getTypeLoc().getBeginLoc(),
TSI->getType());
+ExprResult Sema::ActOnCXXReflectExpr(SourceLocation OpLoc,
+ TypeSourceInfo *TSI) {
+ return BuildCXXReflectExpr(OpLoc, TSI->getTypeLoc().getBeginLoc(),
+ TSI->getType());
}
ExprResult Sema::ActOnCXXReflectExpr(SourceLocation OpLoc,
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp
b/clang/lib/Serialization/ASTReaderStmt.cpp
index cd8f7c460..879a55837 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -529,7 +529,6 @@ void ASTStmtReader::VisitCapturedStmt(CapturedStmt *S) {
}
}
-
void ASTStmtReader::VisitCXXReflectExpr(CXXReflectExpr *E) {
llvm_unreachable("unimplemented");
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/164685
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits