From: Sam McCall Date: Tue, 16 Jul 2019 10:30:21 +0000 (+0000) Subject: [SemaTemplate] Fix uncorrected typos after pack expansion X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a24774fb876488ada117514f82ce33174376080;p=clang [SemaTemplate] Fix uncorrected typos after pack expansion Summary: This case is particularly important for clangd, as it is triggered after inserting the snippet for variadic functions. Reviewers: kadircet, ilya-biryukov Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64677 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366200 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp index 9b23624a9a..d97626551a 100644 --- a/lib/Sema/SemaTemplateVariadic.cpp +++ b/lib/Sema/SemaTemplateVariadic.cpp @@ -619,6 +619,7 @@ ExprResult Sema::CheckPackExpansion(Expr *Pattern, SourceLocation EllipsisLoc, if (!Pattern->containsUnexpandedParameterPack()) { Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs) << Pattern->getSourceRange(); + CorrectDelayedTyposInExpr(Pattern); return ExprError(); } diff --git a/test/SemaTemplate/typo-variadic.cpp b/test/SemaTemplate/typo-variadic.cpp new file mode 100644 index 0000000000..c9b777aebb --- /dev/null +++ b/test/SemaTemplate/typo-variadic.cpp @@ -0,0 +1,2 @@ +// RUN: %clang_cc1 -fsyntax-only %s -verify +int x = m(s...); // expected-error{{pack expansion does not}} expected-error{{undeclared identifier}}