forked from OSchip/llvm-project
In an in-class initialization, defer checks for value-dependent initialization
expressions. llvm-svn: 134583
This commit is contained in:
parent
644247c1dc
commit
365efd62a1
|
@ -1812,9 +1812,11 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
|
|||
ExprResult NewInit = SubstExpr(OldInit, TemplateArgs);
|
||||
|
||||
// If the initialization is no longer dependent, check it now.
|
||||
if ((OldField->getType()->isDependentType() || OldInit->isTypeDependent())
|
||||
&& !NewField->getType()->isDependentType()
|
||||
&& !NewInit.get()->isTypeDependent()) {
|
||||
if ((OldField->getType()->isDependentType() || OldInit->isTypeDependent() ||
|
||||
OldInit->isValueDependent()) &&
|
||||
!NewField->getType()->isDependentType() &&
|
||||
!NewInit.get()->isTypeDependent() &&
|
||||
!NewInit.get()->isValueDependent()) {
|
||||
// FIXME: handle list-initialization
|
||||
SourceLocation EqualLoc = NewField->getLocation();
|
||||
NewInit = PerformCopyInitialization(
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// RUN: %clang_cc1 -emit-llvm-only %s
|
||||
// PR10290
|
||||
|
||||
template<int Flags> struct foo {
|
||||
int value = Flags && 0;
|
||||
};
|
||||
|
||||
void test() {
|
||||
foo<4> bar;
|
||||
}
|
||||
|
Loading…
Reference in New Issue