c++/modules: Add testcase for fixed issue with usings [PR115798]

This issue was fixed by r15-2003-gd6bf4b1c932211, but seems worth adding
to the testsuite.

	PR c++/115798

gcc/testsuite/ChangeLog:

	* g++.dg/modules/using-26_a.C: New test.
	* g++.dg/modules/using-26_b.C: New test.
	* g++.dg/modules/using-26_c.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
This commit is contained in:
Nathaniel Shead 2024-07-12 22:59:19 +10:00
parent 1f7a21c6e8
commit 13757e50ff
3 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,15 @@
// PR c++/115798
// { dg-additional-options "-fmodules-ts" }
// { dg-module-cmi base }
module;
#include <cstdint>
export module base;
export {
using ::int8_t;
}
export namespace std {
using std::int8_t;
}

View file

@ -0,0 +1,10 @@
// PR c++/115798
// { dg-additional-options "-fmodules-ts" }
// { dg-module-cmi xstd }
export module xstd;
import base;
export namespace std {
using std::int8_t;
}

View file

@ -0,0 +1,9 @@
// PR c++/115798
// { dg-additional-options "-fmodules-ts" }
import xstd;
import base;
int main() {
static_assert(__is_same(int8_t, std::int8_t));
}