summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-04 22:03:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-04 22:03:59 +0000
commit363ae815b1cf1ebb6ad6ba47559fa26397b3ae13 (patch)
treed8b7739e352c8fb9b9287d8d66a2b297a89a431a /clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
parente950602d0557bb86610a6f0b6e7ee80f9097c605 (diff)
downloadbcm5719-llvm-363ae815b1cf1ebb6ad6ba47559fa26397b3ae13.tar.gz
bcm5719-llvm-363ae815b1cf1ebb6ad6ba47559fa26397b3ae13.zip
Fix failure to treat overloaded function in braced-init-list as a non-deduced context.
Previously, if an overloaded function in a braced-init-list was encountered in template argument deduction, and the overload set couldn't be resolved to a particular function, we'd immediately produce a deduction failure. That's not correct; this situation is supposed to result in that particular P/A pair being treated as a non-deduced context, and deduction can still succeed if the type can be deduced from elsewhere. llvm-svn: 291014
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r--clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
index c8595d2e364..75c6734bce3 100644
--- a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
+++ b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
@@ -220,10 +220,14 @@ namespace initlist_of_array {
namespace init_list_deduction_failure {
void f();
void f(int);
+ // FIXME: It'd be nice to track that 'T' became a non-deduced context due to
+ // overload resolution failure for 'f'.
template<typename T> void g(std::initializer_list<T>);
- // expected-note@-1 {{candidate template ignored: couldn't resolve reference to overloaded function 'f'}}
- void h() { g({f}); }
- // expected-error@-1 {{no matching function for call to 'g'}}
+ // expected-note@-1 {{candidate template ignored: couldn't infer template argument 'T'}}
+ void h() {
+ g({f}); // expected-error {{no matching function for call to 'g'}}
+ g({f, h}); // ok
+ }
}
namespace deleted_copy {
OpenPOWER on IntegriCloud