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 -- 
clang/test/Parser/cxx-auto-type-specifier.cpp clang/lib/Parse/ParseDecl.cpp 
clang/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p2.cpp clang/test/CXX/drs/cwg3xx.cpp 
clang/test/SemaCXX/auto-cxx0x.cpp clang/test/SemaCXX/class.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/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 51ae39783..a563f04b7 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -4098,14 +4098,14 @@ void Parser::ParseDeclarationSpecifiers(
           // In C++ (not C23), 'auto' cannot be combined with a type specifier.
           // However, OpenCL has its own error handling for this case.
           // Also, static data member definitions are handled by Sema.
-          if (getLangOpts().CPlusPlus && !getLangOpts().C23 && 
+          if (getLangOpts().CPlusPlus && !getLangOpts().C23 &&
               !getLangOpts().OpenCLCPlusPlus) {
-            // Check if this might be a static data member definition (has :: 
in the name).
-            // If so, let Sema handle it with its more specific error message.
-            // Pattern: auto TYPE CLASS::member
-            // We need to look past the type specifier to find ::
+            // Check if this might be a static data member definition (has :: 
in
+            // the name). If so, let Sema handle it with its more specific 
error
+            // message. Pattern: auto TYPE CLASS::member We need to look past
+            // the type specifier to find ::
             bool MightBeStaticDataMember = false;
-            unsigned LookAhead = 2; // Skip 'auto' and the type specifier
+            unsigned LookAhead = 2;   // Skip 'auto' and the type specifier
             while (LookAhead <= 15) { // Safety limit
               Token Next = GetLookAheadToken(LookAhead);
               if (Next.is(tok::coloncolon)) {
@@ -4113,13 +4113,13 @@ void Parser::ParseDeclarationSpecifiers(
                 break;
               }
               // Stop if we hit something that's not part of a qualified name
-              if (Next.is(tok::semi) || Next.is(tok::equal) || 
+              if (Next.is(tok::semi) || Next.is(tok::equal) ||
                   Next.is(tok::l_brace) || Next.is(tok::l_paren)) {
                 break;
               }
               LookAhead++;
             }
-            
+
             if (!MightBeStaticDataMember) {
               isInvalid = true;
               if (!PrevSpec)
@@ -4127,8 +4127,8 @@ void Parser::ParseDeclarationSpecifiers(
               DiagID = diag::err_auto_type_specifier;
             } else {
               // Let it through so Sema can emit the static data member error.
-              isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_auto, 
Loc,
-                                                 PrevSpec, DiagID, Policy);
+              isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_auto,
+                                                 Loc, PrevSpec, DiagID, 
Policy);
             }
           } else {
             // C23 allows 'auto' as storage class with type specifier.

``````````

</details>


https://github.com/llvm/llvm-project/pull/166004
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to