From: Matt Beaumont-Gay Date: Thu, 28 Jun 2012 19:20:41 +0000 (+0000) Subject: Only print a semicolon after "no known conversion for Nth argument" if there X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=712692e130af20b1759b1cf1aae83e22d585233f;p=clang Only print a semicolon after "no known conversion for Nth argument" if there is a following clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159369 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index fb54050254..91f90ca19e 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2167,11 +2167,11 @@ def note_ovl_candidate_bad_conv : Note<"candidate " "function (the implicit move assignment operator)|" "constructor (inherited)}0%1" " not viable: no known conversion %diff{from | to | }2,3for " - "%select{%ordinal5 argument|object argument}4; " - "%select{|dereference the argument with *|" - "take the address of the argument with &|" - "remove *|" - "remove &}6">; + "%select{%ordinal5 argument|object argument}4" + "%select{|; dereference the argument with *|" + "; take the address of the argument with &|" + "; remove *|" + "; remove &}6">; def note_ovl_candidate_bad_arc_conv : Note<"candidate " "%select{function|function|constructor|" "function |function |constructor |" diff --git a/test/Misc/diag-aka-types.cpp b/test/Misc/diag-aka-types.cpp index e82c62d3ce..3a00b7122e 100644 --- a/test/Misc/diag-aka-types.cpp +++ b/test/Misc/diag-aka-types.cpp @@ -40,7 +40,7 @@ struct data { int i; }; typedef void (*callback)(struct data *); -void helper(callback cb) {} // expected-note{{candidate function not viable: no known conversion from 'void (*)(struct data *)' (aka 'void (*)(ns::data *)') to 'callback' (aka 'void (*)(struct data *)') for 1st argument;}} +void helper(callback cb) {} // expected-note{{candidate function not viable: no known conversion from 'void (*)(struct data *)' (aka 'void (*)(ns::data *)') to 'callback' (aka 'void (*)(struct data *)') for 1st argument}} void test() { helper(&ns::str::method); // expected-error{{no matching function for call to 'helper'}} diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp index 9b5e6951e3..0e7a678ad7 100644 --- a/test/Misc/diag-template-diffing.cpp +++ b/test/Misc/diag-template-diffing.cpp @@ -194,39 +194,39 @@ void test7() { set7(class7()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set7' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set7' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set7' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7<&b7>' to 'class7<&a7>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set7' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class7' to 'class7<&a7>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set7' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: class7< // CHECK-ELIDE-TREE: [&b7 != &a7]> // CHECK-ELIDE-TREE: no matching function for call to 'set7' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: class7< // CHECK-ELIDE-TREE: [c7 != &a7]> // CHECK-ELIDE-TREE: no matching function for call to 'set7' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: class7< // CHECK-ELIDE-TREE: [nullptr != &a7]> // CHECK-NOELIDE-TREE: no matching function for call to 'set7' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: class7< // CHECK-NOELIDE-TREE: [&b7 != &a7]> // CHECK-NOELIDE-TREE: no matching function for call to 'set7' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: class7< // CHECK-NOELIDE-TREE: [c7 != &a7]> // CHECK-NOELIDE-TREE: no matching function for call to 'set7' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: class7< // CHECK-NOELIDE-TREE: [nullptr != &a7]> @@ -235,16 +235,16 @@ template using U8 = S8; int f8(S8); int k8 = f8(U8()); // CHECK-ELIDE-NOTREE: no matching function for call to 'f8' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<[2 * ...], char>' to 'S8<[2 * ...], double>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S8<[2 * ...], char>' to 'S8<[2 * ...], double>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f8' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S8' to 'S8' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S8' to 'S8' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f8' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: S8< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [char != double]> // CHECK-NOELIDE-TREE: no matching function for call to 'f8' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: S8< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: char, @@ -257,18 +257,18 @@ int f9(S9>); int k9 = f9(V9()); // CHECK-ELIDE-NOTREE: no matching function for call to 'f9' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<[2 * ...], S9<[2 * ...], double>>' to 'S9<[2 * ...], S9<[2 * ...], const double>>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'S9<[2 * ...], S9<[2 * ...], double>>' to 'S9<[2 * ...], S9<[2 * ...], const double>>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'f9' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S9>' to 'S9>' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'S9>' to 'S9>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'f9' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: S9< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: S9< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [double != const double]>> // CHECK-NOELIDE-TREE: no matching function for call to 'f9' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: S9< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: char, @@ -285,30 +285,30 @@ void test10() { } // CHECK-ELIDE-NOTREE: no matching function for call to 'set10' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[...], (no argument)>' to 'class_types<[...], int>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[...], (no argument)>' to 'class_types<[...], int>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set10' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[2 * ...], int>' to 'class_types<[2 * ...], (no argument)>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types<[2 * ...], int>' to 'class_types<[2 * ...], (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set10' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types' to 'class_types' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types' to 'class_types' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set10' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types' to 'class_types' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_types' to 'class_types' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set10' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: class_types< // CHECK-ELIDE-TREE: [...], // CHECK-ELIDE-TREE: [(no argument) != int]> // CHECK-ELIDE-TREE: no matching function for call to 'set10' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: class_types< // CHECK-ELIDE-TREE: [2 * ...], // CHECK-ELIDE-TREE: [int != (no argument)]> // CHECK-NOELIDE-TREE: no matching function for call to 'set10' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: class_types< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: [(no argument) != int]> // CHECK-NOELIDE-TREE: no matching function for call to 'set10' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: class_types< // CHECK-NOELIDE-TREE: int, // CHECK-NOELIDE-TREE: int, @@ -321,31 +321,31 @@ void test11() { set11(class_ints<0, 3, 6>()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set11' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument // CHECK-ELIDE-NOTREE: no matching function for call to 'set11' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, [...], 6>' to 'class_ints<2, [...], (no argument)>' for 1st argument; +// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, [...], 6>' to 'class_ints<2, [...], (no argument)>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set11' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<1, (no argument)>' to 'class_ints<2, 3>' for 1st argument // CHECK-NOELIDE-NOTREE: no matching function for call to 'set11' -// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, 3, 6>' to 'class_ints<2, 3, (no argument)>' for 1st argument; +// CHECK-NOELIDE-NOTREE: candidate function not viable: no known conversion from 'class_ints<0, 3, 6>' to 'class_ints<2, 3, (no argument)>' for 1st argument // CHECK-ELIDE-TREE: no matching function for call to 'set11' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: class_ints< // CHECK-ELIDE-TREE: [1 != 2], // CHECK-ELIDE-TREE: [(no argument) != 3]> // CHECK-ELIDE-TREE: no matching function for call to 'set11' -// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-ELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-ELIDE-TREE: class_ints< // CHECK-ELIDE-TREE: [0 != 2], // CHECK-ELIDE-TREE: [...], // CHECK-ELIDE-TREE: [6 != (no argument)]> // CHECK-NOELIDE-TREE: no matching function for call to 'set11' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: class_ints< // CHECK-NOELIDE-TREE: [1 != 2], // CHECK-NOELIDE-TREE: [(no argument) != 3]> // CHECK-NOELIDE-TREE: no matching function for call to 'set11' -// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument; +// CHECK-NOELIDE-TREE: candidate function not viable: no known conversion for 1st argument // CHECK-NOELIDE-TREE: class_ints< // CHECK-NOELIDE-TREE: [0 != 2], // CHECK-NOELIDE-TREE: 3, @@ -360,30 +360,30 @@ void test12() { set12(class_template_templates()); } // CHECK-ELIDE-NOTREE: no matching function for call to 'set12' -// CHECK-ELIDE-NOTREE: candidate function not viable: no known conversion from 'class_template_templates