[clang] [clang][Sema] Emit more specific diagnostic for auto in lambda before C++14 (#46059) (PR #68540)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 11 14:02:29 PDT 2023
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 606f89ab7d537ca068fb1be9fd89d96a30de38f8 031e76900f6e63c97ed8666066ff98d967305af4 -- clang/lib/Sema/SemaType.cpp clang/test/SemaCXX/auto-cxx0x.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index da759ba340c7..4f54645a9c14 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -3610,7 +3610,8 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state,
Error = 24; // auto not allowed in lambda parameter (before C++14)
break;
} else if (!Auto || Auto->getKeyword() != AutoTypeKeyword::Auto) {
- Error = 16; // __auto_type or decltype(auto) not allowed in lambda parameter
+ Error = 16; // __auto_type or decltype(auto) not allowed in lambda
+ // parameter
break;
}
Info = SemaRef.getCurLambda();
``````````
</details>
https://github.com/llvm/llvm-project/pull/68540
More information about the cfe-commits
mailing list