aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/param-type-mismatch-2.C20
-rw-r--r--gcc/testsuite/g++.dg/overload/error6.C9
2 files changed, 19 insertions, 10 deletions
diff --git a/gcc/testsuite/g++.dg/diagnostic/param-type-mismatch-2.C b/gcc/testsuite/g++.dg/diagnostic/param-type-mismatch-2.C
index de7570a..50c25cd 100644
--- a/gcc/testsuite/g++.dg/diagnostic/param-type-mismatch-2.C
+++ b/gcc/testsuite/g++.dg/diagnostic/param-type-mismatch-2.C
@@ -129,22 +129,22 @@ int test_6 (int first, const char *second, float third, s6 *ptr)
/* Template function. */
template <typename T>
-int test_7 (int one, T two, float three); // { dg-line test_7_decl }
+int callee_7 (int one, T two, float three); // { dg-line callee_7_decl }
int test_7 (int first, const char *second, float third)
{
- return test_7 <const char **> (first, second, third); // { dg-line test_7_usage }
- // { dg-message "cannot convert 'const char\\*' to 'const char\\*\\*'" "" { target *-*-* } test_7_usage }
+ return callee_7 <const char **> (first, second, third); // { dg-line callee_7_usage }
+ // { dg-message "cannot convert 'const char\\*' to 'const char\\*\\*'" "" { target *-*-* } callee_7_usage }
/* { dg-begin-multiline-output "" }
- return test_7 <const char **> (first, second, third);
- ^~~~~~
- |
- const char*
+ return callee_7 <const char **> (first, second, third);
+ ^~~~~~
+ |
+ const char*
{ dg-end-multiline-output "" } */
- // { dg-message "initializing argument 2 of 'int test_7\\(int, T, float\\) .with T = const char\\*\\*.'" "" { target *-*-* } test_7_decl }
+ // { dg-message "initializing argument 2 of 'int callee_7\\(int, T, float\\) .with T = const char\\*\\*.'" "" { target *-*-* } callee_7_decl }
/* { dg-begin-multiline-output "" }
- int test_7 (int one, T two, float three);
- ~~^~~
+ int callee_7 (int one, T two, float three);
+ ~~^~~
{ dg-end-multiline-output "" } */
}
diff --git a/gcc/testsuite/g++.dg/overload/error6.C b/gcc/testsuite/g++.dg/overload/error6.C
new file mode 100644
index 0000000..86a12ea
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/error6.C
@@ -0,0 +1,9 @@
+// Verify we note even non-template candidates when diagnosing
+// overload resolution failure for a template-id.
+
+template<class T> void f(T); // { dg-message "candidate" }
+void f(int); // { dg-message {candidate: 'void f\(int\)' \(ignored\)} }
+
+int main() {
+ f<int>(0, 0); // { dg-error "no match" }
+}