diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 195e1202880b9..d6f1ccc38156d 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -105,7 +105,6 @@ def note_replace_abs_function : Note<"use function '%0' instead">; def warn_pointer_abs : Warning< "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">, InGroup; - def warn_max_unsigned_zero : Warning< "taking the max of " "%select{a value and unsigned zero|unsigned zero and a value}0 " diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index 32b08a12a3bb6..91342360db125 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -1269,7 +1269,9 @@ static void tryConsumeLambdaSpecifierToken(Parser &P, DeclEndLoc = SpecifierLoc; }; - while (true) { + // Process lambda specifiers until an invalid token is found + while (P.getCurToken().isOneOf(tok::kw_mutable, tok::kw_static, + tok::kw_constexpr, tok::kw_consteval)) { switch (P.getCurToken().getKind()) { case tok::kw_mutable: ConsumeLocation(MutableLoc, 0); @@ -1284,7 +1286,7 @@ static void tryConsumeLambdaSpecifierToken(Parser &P, ConsumeLocation(ConstevalLoc, 3); break; default: - return; + llvm_unreachable("Unexpected token in lambda specifier parsing"); } } } diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp index b4e100a76a081..8116ec2de87a9 100644 --- a/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.variadic/init-capture.cpp @@ -22,7 +22,7 @@ template void f(T ...t) { // Not OK: can't expand 'x' outside its scope. weird((void)[&...x = t] { return &x; // expected-error {{unexpanded parameter pack 'x'}} - }... // expected-error {{does not contain any unexpanded}} + }... // expected-error {{pack expansion does not contain any unexpanded parameter packs}} ); // OK, capture only one 'slice' of 'x'. @@ -34,7 +34,7 @@ template void f(T ...t) { // 'x' is not expanded by the outer '...', but 'T' is. weird((void)[&... x = t] { return T() + &x; // expected-error {{unexpanded parameter pack 'x'}} - }... // expected-error {{does not contain any unexpanded}} + }... // expected-error {{pack expansion does not contain any unexpanded parameter packs}} ); } @@ -43,7 +43,7 @@ static_assert(x<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) static_assert(x<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) == 124); // expected-error {{failed}} \ // expected-note {{evaluates to '123 == 124'}} -template constexpr auto y = [z = a...] (auto F) { return F(z...); }; // expected-error {{must appear before the name of the capture}} +template constexpr auto y = [z = a...] (auto F) { return F(z...); }; // expected-error {{ellipsis in pack init-capture must appear before the name of the capture}} static_assert(y<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) == 123); static_assert(y<1,2,3>([](int a, int b, int c) { return 100 * a + 10 * b + c; }) == 124); // expected-error {{failed}} \ // expected-note {{evaluates to '123 == 124'}}