diff options
author | Arsen Arsenović <arsen@aarsen.me> | 2023-03-08 17:01:24 +0100 |
---|---|---|
committer | Arsen Arsenović <arsen@aarsen.me> | 2023-04-05 18:45:14 +0200 |
commit | 6f0d67b912900009bff5018bd58e17ea1db1de69 (patch) | |
tree | 8cd5cd11a20e511d0ec7eed0d126e1dba1cbef5b /libstdc++-v3/testsuite | |
parent | 9d63ce7c4c0a993c419dceb823e71cba5da99e24 (diff) | |
download | gcc-6f0d67b912900009bff5018bd58e17ea1db1de69.tar.gz |
libstdc++: Add a test for <version> FTM redefinitions
This test detects redefinitions by compiling stdc++.h and <version>, by
disabling the system_header pragma on the latter, to allow warnings in
it. Thanks Patrick Palka for the suggestion.
libstdc++-v3/ChangeLog:
* testsuite/17_intro/versionconflict.cc: New test.
* include/std/version: Allow disabling the system_header pragma
via _GLIBCXX_TESTING_SYSHDR.
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r-- | libstdc++-v3/testsuite/17_intro/versionconflict.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/17_intro/versionconflict.cc b/libstdc++-v3/testsuite/17_intro/versionconflict.cc new file mode 100644 index 00000000000..6c212980ab0 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/versionconflict.cc @@ -0,0 +1,7 @@ +// { dg-do preprocess } +// { dg-additional-options "-Werror" } + +// Test for redefinitions of FTMs using bits/stdc++.h. +#define _GLIBCXX_TESTING_SYSHDR +#include <bits/stdc++.h> +#include <version> |