r366200 - [SemaTemplate] Fix uncorrected typos after pack expansion
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 16 03:30:21 PDT 2019
Author: sammccall
Date: Tue Jul 16 03:30:21 2019
New Revision: 366200
URL: http://llvm.org/viewvc/llvm-project?rev=366200&view=rev
Log:
[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
Added:
cfe/trunk/test/SemaTemplate/typo-variadic.cpp
Modified:
cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp?rev=366200&r1=366199&r2=366200&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateVariadic.cpp Tue Jul 16 03:30:21 2019
@@ -619,6 +619,7 @@ ExprResult Sema::CheckPackExpansion(Expr
if (!Pattern->containsUnexpandedParameterPack()) {
Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
<< Pattern->getSourceRange();
+ CorrectDelayedTyposInExpr(Pattern);
return ExprError();
}
Added: cfe/trunk/test/SemaTemplate/typo-variadic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/typo-variadic.cpp?rev=366200&view=auto
==============================================================================
--- cfe/trunk/test/SemaTemplate/typo-variadic.cpp (added)
+++ cfe/trunk/test/SemaTemplate/typo-variadic.cpp Tue Jul 16 03:30:21 2019
@@ -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}}
More information about the cfe-commits
mailing list