[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 13:54:05 PDT 2023
================
@@ -3605,8 +3605,11 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state,
Info = &SemaRef.InventedParameterInfos.back();
} else {
// In C++14, generic lambdas allow 'auto' in their parameters.
- if (!SemaRef.getLangOpts().CPlusPlus14 || !Auto ||
- Auto->getKeyword() != AutoTypeKeyword::Auto) {
+ if (!SemaRef.getLangOpts().CPlusPlus14 && Auto &&
+ Auto->getKeyword() == AutoTypeKeyword::Auto) {
+ Error = 24;
----------------
weltschildkroete wrote:
Makes sense. I added some similar comments as well.
https://github.com/llvm/llvm-project/pull/68540
More information about the cfe-commits
mailing list