[PATCH] D17762: Fix an assertion failure in setPointOfInstantiation.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 7 01:59:15 PST 2016
hokein updated this revision to Diff 49939.
hokein added a comment.
Update.
http://reviews.llvm.org/D17762
Files:
lib/Sema/SemaExpr.cpp
test/Sema/PR25668.cpp
Index: test/Sema/PR25668.cpp
===================================================================
--- /dev/null
+++ test/Sema/PR25668.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -verify -fsyntax-only -std=c++11 %s
+// expected-no-assertion-crash
+
+template <class> class A {};
+struct B {
+ A<int> operator[](int);
+} mask_ {
+ mask[2]; // expected-error{{use of undeclared identifier 'mask'}}
+};
Index: lib/Sema/SemaExpr.cpp
===================================================================
--- lib/Sema/SemaExpr.cpp
+++ lib/Sema/SemaExpr.cpp
@@ -14044,6 +14044,9 @@
if (ReturnType->isVoidType() || !ReturnType->isIncompleteType())
return false;
+ if (Loc.isInvalid())
+ return true;
+
// If we're inside a decltype's expression, don't check for a valid return
// type or construct temporaries until we know whether this is the last call.
if (ExprEvalContexts.back().IsDecltype) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17762.49939.patch
Type: text/x-patch
Size: 906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160307/8915a55c/attachment.bin>
More information about the cfe-commits
mailing list