]> granicus.if.org Git - clang/commit
A little tweak to the SFINAE condition reporting. Don't say:
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 9 May 2012 05:17:00 +0000 (05:17 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 9 May 2012 05:17:00 +0000 (05:17 +0000)
commit4493c0aa8add05b2fc534b0d8970c4b5480fad3b
tree460cb8211a76b4b7a30527d2c53c126d9274fbf4
parent2d99c59aced6d6cd599209cb999a7da773702a42
A little tweak to the SFINAE condition reporting. Don't say:

  candidate template ignored: substitution failed [with T = int]: no type named 'type' in 'std::enable_if<false, void>'

Instead, just say:

  candidate template ignored: disabled by 'enable_if' [with T = int]

... and point at the enable_if condition which (we assume) failed.

This is applied to all cases where the user writes 'typename enable_if<...>::type' (optionally prefixed with a nested name specifier), and 'enable_if<...>' names a complete class type which does not have a member named 'type', and this results in a candidate function being ignored in a SFINAE context. Thus it catches 'std::enable_if', 'std::__1::enable_if', 'boost::enable_if' and 'llvm::enable_if'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156463 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaOverload.cpp
lib/Sema/SemaTemplate.cpp
test/SemaTemplate/overload-candidates.cpp