From 1bfab1dc79bef1f1120bda37556f2e372a2378f5 Mon Sep 17 00:00:00 2001 From: Nathaniel Shead Date: Tue, 11 Feb 2025 22:24:55 +1100 Subject: testsuite: Fix g++.dg/modules/adl-5 This testcase wasn't running, because adl-5_a had the wrong extension. adl-5_d should have been reporting an error because 'frob' is only visible from within the 'hidden' module but this was missed. gcc/testsuite/ChangeLog: * g++.dg/modules/adl-5_a.c: Move to... * g++.dg/modules/adl-5_a.C: ...here. * g++.dg/modules/adl-5_d.C: Add errors. Signed-off-by: Nathaniel Shead --- gcc/testsuite/g++.dg/modules/adl-5_a.C | 9 +++++++++ gcc/testsuite/g++.dg/modules/adl-5_a.c | 9 --------- gcc/testsuite/g++.dg/modules/adl-5_d.C | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/g++.dg/modules/adl-5_a.C delete mode 100644 gcc/testsuite/g++.dg/modules/adl-5_a.c diff --git a/gcc/testsuite/g++.dg/modules/adl-5_a.C b/gcc/testsuite/g++.dg/modules/adl-5_a.C new file mode 100644 index 0000000..5b86922 --- /dev/null +++ b/gcc/testsuite/g++.dg/modules/adl-5_a.C @@ -0,0 +1,9 @@ +// { dg-additional-options -fmodules-ts } +export module foo; +// { dg-module-cmi foo } + +export template +int TPL (T const &t) +{ + return frob (t); +} diff --git a/gcc/testsuite/g++.dg/modules/adl-5_a.c b/gcc/testsuite/g++.dg/modules/adl-5_a.c deleted file mode 100644 index 5b86922..0000000 --- a/gcc/testsuite/g++.dg/modules/adl-5_a.c +++ /dev/null @@ -1,9 +0,0 @@ -// { dg-additional-options -fmodules-ts } -export module foo; -// { dg-module-cmi foo } - -export template -int TPL (T const &t) -{ - return frob (t); -} diff --git a/gcc/testsuite/g++.dg/modules/adl-5_d.C b/gcc/testsuite/g++.dg/modules/adl-5_d.C index 9c75b6d..cf93b04 100644 --- a/gcc/testsuite/g++.dg/modules/adl-5_d.C +++ b/gcc/testsuite/g++.dg/modules/adl-5_d.C @@ -7,10 +7,11 @@ int main () { X x (2); - if (frob (x) != 2) + if (frob (x) != 2) // { dg-error "not declared in" } return 1; - if (TPL (x) != 2) + // { dg-regexp "\n\[^\n]*adl-5_a.C:8:15: error: 'frob' was not declared in this scope$" } + if (TPL (x) != 2) // { dg-message "required from here" } return 2; return 0; -- cgit v1.1