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 cpp,cppm,h --
clang/include/clang/Basic/IdentifierTable.h
clang/include/clang/Basic/TokenKinds.h
clang/include/clang/Frontend/CompilerInstance.h
clang/include/clang/Lex/CodeCompletionHandler.h
clang/include/clang/Lex/DependencyDirectivesScanner.h
clang/include/clang/Lex/ModuleLoader.h clang/include/clang/Lex/Preprocessor.h
clang/include/clang/Lex/Token.h clang/include/clang/Lex/TokenLexer.h
clang/include/clang/Parse/Parser.h clang/lib/Basic/IdentifierTable.cpp
clang/lib/Basic/TokenKinds.cpp
clang/lib/DependencyScanning/ModuleDepCollector.cpp
clang/lib/Frontend/CompilerInstance.cpp clang/lib/Frontend/InitPreprocessor.cpp
clang/lib/Frontend/PrintPreprocessedOutput.cpp
clang/lib/Lex/DependencyDirectivesScanner.cpp clang/lib/Lex/Lexer.cpp
clang/lib/Lex/PPDirectives.cpp clang/lib/Lex/Preprocessor.cpp
clang/lib/Lex/TokenConcatenation.cpp clang/lib/Lex/TokenLexer.cpp
clang/lib/Parse/Parser.cpp clang/lib/Sema/SemaModule.cpp
clang/test/CXX/basic/basic.link/p3.cpp
clang/test/CXX/basic/basic.scope/basic.scope.namespace/p2.cpp
clang/test/CXX/lex/lex.pptoken/p3-2a.cpp
clang/test/CXX/module/basic/basic.link/module-declaration.cpp
clang/test/CXX/module/dcl.dcl/dcl.module/dcl.module.import/p1.cppm
clang/test/Modules/pr121066.cpp
clang/test/Modules/preprocess-named-modules.cppm
clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
clang/unittests/Lex/DependencyDirectivesScannerTest.cpp
clang/unittests/Lex/ModuleDeclStateTest.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/Lex/CodeCompletionHandler.h
b/clang/include/clang/Lex/CodeCompletionHandler.h
index bd3e05a36..bd4fa2bd5 100644
--- a/clang/include/clang/Lex/CodeCompletionHandler.h
+++ b/clang/include/clang/Lex/CodeCompletionHandler.h
@@ -69,7 +69,7 @@ public:
/// Callback invoked when performing code completion in a part of the
/// file where we expect natural language, e.g., a comment, string, or
/// \#error directive.
- virtual void CodeCompleteNaturalLanguage() { }
+ virtual void CodeCompleteNaturalLanguage() {}
};
}
diff --git a/clang/lib/Basic/IdentifierTable.cpp
b/clang/lib/Basic/IdentifierTable.cpp
index 9b4019834..43d193906 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -430,7 +430,7 @@ tok::PPKeywordKind IdentifierInfo::getPPKeywordID() const {
CASE( 6, 'a', 's', assert);
CASE( 6, 'd', 'f', define);
CASE( 6, 'i', 'n', ifndef);
- CASE( 6, 'i', 'p', import);
+ CASE(6, 'i', 'p', import);
CASE( 6, 'p', 'a', pragma);
CASE( 7, 'd', 'f', defined);
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 0a25dc195..db3dce2f6 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -1130,11 +1130,15 @@ void
Preprocessor::CollectPpImportSuffix(SmallVectorImpl<Token> &Toks) {
Lex(Toks.back());
switch (Toks.back().getKind()) {
- case tok::l_paren: case tok::l_square: case tok::l_brace:
+ case tok::l_paren:
+ case tok::l_square:
+ case tok::l_brace:
++BracketDepth;
break;
- case tok::r_paren: case tok::r_square: case tok::r_brace:
+ case tok::r_paren:
+ case tok::r_square:
+ case tok::r_brace:
if (BracketDepth == 0)
return;
--BracketDepth;
@@ -1143,7 +1147,7 @@ void
Preprocessor::CollectPpImportSuffix(SmallVectorImpl<Token> &Toks) {
case tok::semi:
if (BracketDepth == 0)
return;
- break;
+ break;
case tok::eof:
return;
@@ -1154,7 +1158,6 @@ void
Preprocessor::CollectPpImportSuffix(SmallVectorImpl<Token> &Toks) {
}
}
-
/// Lex a token following the 'import' contextual keyword.
///
/// pp-import: [C++20]
@@ -1346,8 +1349,7 @@ bool Preprocessor::LexAfterModuleImport(Token &Result) {
// We don't/shouldn't load the standard c++20 modules when preprocessing.
if (getLangOpts().Modules && !isInImportingCXXNamedModules()) {
Imported = TheModuleLoader.loadModule(ModuleImportLoc,
- NamedModuleImportPath,
- Module::Hidden,
+ NamedModuleImportPath,
Module::Hidden,
/*IsInclusionDirective=*/false);
if (Imported)
makeModuleVisible(Imported, SemiLoc);
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index cbe37cd47..a8bfef390 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -305,7 +305,7 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc,
SourceLocation ModuleLoc,
// We were asked to compile a module interface unit but this is a module
// implementation unit.
Diag(ModuleLoc, diag::err_module_interface_implementation_mismatch)
- << FixItHint::CreateInsertion(ModuleLoc, "export ");
+ << FixItHint::CreateInsertion(ModuleLoc, "export ");
MDK = ModuleDeclKind::Interface;
break;
@@ -388,7 +388,7 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc,
SourceLocation ModuleLoc,
<< getLangOpts().CurrentModule;
return nullptr;
}
- const_cast<LangOptions&>(getLangOpts()).CurrentModule = ModuleName;
+ const_cast<LangOptions &>(getLangOpts()).CurrentModule = ModuleName;
auto &Map = PP.getHeaderSearchInfo().getModuleMap();
Module *Mod; // The module we are creating.
@@ -433,7 +433,7 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc,
SourceLocation ModuleLoc,
Interface = getModuleLoader().loadModule(ModuleLoc, {ModuleNameLoc},
Module::AllVisible,
/*IsInclusionDirective=*/false);
- const_cast<LangOptions&>(getLangOpts()).CurrentModule = ModuleName;
+ const_cast<LangOptions &>(getLangOpts()).CurrentModule = ModuleName;
if (!Interface) {
Diag(ModuleLoc, diag::err_module_not_defined) << ModuleName;
``````````
</details>
https://github.com/llvm/llvm-project/pull/173118
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits