Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -2216,7 +2216,6 @@ return Eval->Evaluated.isUninit() ? nullptr : &Eval->Evaluated; const auto *Init = cast(Eval->Value); - assert(!Init->isValueDependent()); if (Eval->IsEvaluating) { // FIXME: Produce a diagnostic for self-initialization. @@ -2284,7 +2283,6 @@ return Eval->IsICE; const auto *Init = cast(Eval->Value); - assert(!Init->isValueDependent()); // In C++11, evaluate the initializer to check whether it's a constant // expression. Index: lib/AST/ExprConstant.cpp =================================================================== --- lib/AST/ExprConstant.cpp +++ lib/AST/ExprConstant.cpp @@ -10250,7 +10250,6 @@ } static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) { - assert(!E->isValueDependent() && "Should not see value dependent exprs!"); if (!E->getType()->isIntegralOrEnumerationType()) return ICEDiag(IK_NotICE, E->getLocStart()); Index: test/SemaTemplate/illformed-template-ice.cpp =================================================================== --- test/SemaTemplate/illformed-template-ice.cpp +++ test/SemaTemplate/illformed-template-ice.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +class A { +public: + template void B(); +}; + +namespace { + template void A::B() { // expected-error {{cannot define or redeclare 'B' here because namespace '' does not enclose namespace 'A'}} + const int a = sizeof(T); + int b = a; + } +}