summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/overload-call.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-11-30 08:18:21 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-11-30 08:18:21 +0000
commit527b3966d0e5fd25bce79b2409cd1a317563d338 (patch)
treeebd1cd3ae7bd6b24eb469ba3bfada0eefffc94c1 /clang/test/SemaCXX/overload-call.cpp
parent422e80aee2baf32d981e96406dfedc6708282e61 (diff)
downloadbcm5719-llvm-527b3966d0e5fd25bce79b2409cd1a317563d338.tar.gz
bcm5719-llvm-527b3966d0e5fd25bce79b2409cd1a317563d338.zip
Preserve the "last diagnostic was suppressed" flag across SFINAE checks.
Sometimes we check the validity of some construct between producing a diagnostic and producing its notes. Ideally, we wouldn't do that, but in practice running code that "cannot possibly produce a diagnostic" in such a situation should be safe, and reasonable factoring of some code requires it with our current diagnostics infrastruture. If this does happen, a diagnostic that's suppressed due to SFINAE should not cause notes connected to the prior diagnostic to be suppressed. llvm-svn: 319408
Diffstat (limited to 'clang/test/SemaCXX/overload-call.cpp')
-rw-r--r--clang/test/SemaCXX/overload-call.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/overload-call.cpp b/clang/test/SemaCXX/overload-call.cpp
index 0e3a9ee50bb..0c4bba5027f 100644
--- a/clang/test/SemaCXX/overload-call.cpp
+++ b/clang/test/SemaCXX/overload-call.cpp
@@ -658,3 +658,11 @@ namespace StringLiteralToCharAmbiguity {
// expected-note@-5 {{candidate function}}
#endif
}
+
+namespace ProduceNotesAfterSFINAEFailure {
+ struct A {
+ template<typename T, typename U = typename T::x> A(T); // expected-warning 0-1{{extension}}
+ };
+ void f(void*, A); // expected-note {{candidate function not viable}}
+ void g() { f(1, 2); } // expected-error {{no matching function}}
+}
OpenPOWER on IntegriCloud