[llvm-branch-commits] [cfe-branch] r325766 - Merging r324308:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Feb 22 03:25:29 PST 2018
Author: hans
Date: Thu Feb 22 03:25:29 2018
New Revision: 325766
URL: http://llvm.org/viewvc/llvm-project?rev=325766&view=rev
Log:
Merging r324308:
------------------------------------------------------------------------
r324308 | rtrieu | 2018-02-06 03:58:21 +0100 (Tue, 06 Feb 2018) | 4 lines
Fix crash on invalid.
Don't call a method when the pointer is null.
------------------------------------------------------------------------
Modified:
cfe/branches/release_60/ (props changed)
cfe/branches/release_60/lib/Sema/SemaExpr.cpp
cfe/branches/release_60/test/SemaCXX/lambda-expressions.cpp
Propchange: cfe/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 22 03:25:29 2018
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:321754,321771,321777,321779,321933,322018,322236,322245-322246,322350,322390,322405,322420,322518,322593,322813,322901,322904,322984,323008,323123,323155,323360,323485,323904,323935,323998,324059,324134,324246,324419,324439,324514,324537,324594,325375,325576,325655
+/cfe/trunk:321754,321771,321777,321779,321933,322018,322236,322245-322246,322350,322390,322405,322420,322518,322593,322813,322901,322904,322984,323008,323123,323155,323360,323485,323904,323935,323998,324059,324134,324246,324308,324419,324439,324514,324537,324594,325375,325576,325655
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_60/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_60/lib/Sema/SemaExpr.cpp?rev=325766&r1=325765&r2=325766&view=diff
==============================================================================
--- cfe/branches/release_60/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/release_60/lib/Sema/SemaExpr.cpp Thu Feb 22 03:25:29 2018
@@ -14926,7 +14926,8 @@ static void DoMarkVarDeclReferenced(Sema
if (RefersToEnclosingScope) {
LambdaScopeInfo *const LSI =
SemaRef.getCurLambda(/*IgnoreNonLambdaCapturingScope=*/true);
- if (LSI && !LSI->CallOperator->Encloses(Var->getDeclContext())) {
+ if (LSI && (!LSI->CallOperator ||
+ !LSI->CallOperator->Encloses(Var->getDeclContext()))) {
// If a variable could potentially be odr-used, defer marking it so
// until we finish analyzing the full expression for any
// lvalue-to-rvalue
Modified: cfe/branches/release_60/test/SemaCXX/lambda-expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_60/test/SemaCXX/lambda-expressions.cpp?rev=325766&r1=325765&r2=325766&view=diff
==============================================================================
--- cfe/branches/release_60/test/SemaCXX/lambda-expressions.cpp (original)
+++ cfe/branches/release_60/test/SemaCXX/lambda-expressions.cpp Thu Feb 22 03:25:29 2018
@@ -608,3 +608,18 @@ namespace ConversionOperatorDoesNotHaveD
// This used to crash in return type deduction for the conversion opreator.
struct A { int n; void f() { +[](decltype(n)) {}; } };
}
+
+namespace TypoCorrection {
+template <typename T> struct X {};
+// expected-note at -1 {{template parameter is declared here}}
+
+template <typename T>
+void Run(const int& points) {
+// expected-note at -1 {{'points' declared here}}
+ auto outer_lambda = []() {
+ auto inner_lambda = [](const X<Points>&) {};
+ // expected-error at -1 {{use of undeclared identifier 'Points'; did you mean 'points'?}}
+ // expected-error at -2 {{template argument for template type parameter must be a type}}
+ };
+}
+}
More information about the llvm-branch-commits
mailing list