gcc/testsuite/g++.dg/modules/concept-2_a.C
raw| 1 | // { dg-additional-options "-fmodules-ts -fconcepts" } |
| 2 | |
| 3 | export module foo; |
| 4 | // { dg-module-cmi foo } |
| 5 | |
| 6 | export template<typename T> |
| 7 | requires (sizeof (T) == 1) |
| 8 | char f1 (T x) { return 0; } |
| 9 | |
| 10 | export template<typename T> |
| 11 | requires (sizeof (T) != 1) |
| 12 | int f1 (T x) { return 0; } |
| 13 | |
| 14 | void foo (int i, char c) |
| 15 | { |
| 16 | static_assert (sizeof (f1 (i)) == sizeof (int)); |
| 17 | static_assert (sizeof (f1 (c)) == sizeof (char)); |
| 18 | } |