[Sema] Fix a bug in enable_if condition instantiation.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 17 Nov 2016 01:33:54 +0000 (01:33 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 17 Nov 2016 01:33:54 +0000 (01:33 +0000)
commit004319554cf6044896073b8a305ba9d340ed5f94
treefc75b136e29d455e13de0e8216ead7ade1e8028a
parent41d72a8632605ad9366b9bfcd12fe80a177b80ca
[Sema] Fix a bug in enable_if condition instantiation.

During template instantiation, we currently fall back to just calling
Sema::SubstExpr for enable_if attributes that aren't value-dependent or
type-dependent. Since Sema::SubstExpr strips off any implicit casts
we've added to an expression, it's possible that this behavior will
leave us with an enable_if condition that's just a DeclRefExpr.
Conditions like that deeply confuse Sema::CheckEnableIf.

llvm-svn: 287187
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/SemaCXX/enable_if.cpp