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) {
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) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits