This test detects redefinitions by compiling stdc++.h with -Wsystem-headers. Thanks Patrick Palka for the suggestion.
libstdc++-v3/ChangeLog: * testsuite/17_intro/versionconflict.cc: New test. --- libstdc++-v3/testsuite/17_intro/versionconflict.cc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 libstdc++-v3/testsuite/17_intro/versionconflict.cc diff --git a/libstdc++-v3/testsuite/17_intro/versionconflict.cc b/libstdc++-v3/testsuite/17_intro/versionconflict.cc new file mode 100644 index 00000000000..4191c7a2b08 --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/versionconflict.cc @@ -0,0 +1,6 @@ +// { dg-do preprocess } +// { dg-additional-options "-Wsystem-headers -Werror" } + +// Test for redefinitions of FTMs using bits/stdc++.h. +#include <bits/stdc++.h> +#include <version> -- 2.39.2