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.
This commit is contained in:
parent
9d63ce7c4c
commit
6f0d67b912
2 changed files with 11 additions and 1 deletions
|
@ -30,7 +30,10 @@
|
|||
#ifndef _GLIBCXX_VERSION_INCLUDED
|
||||
#define _GLIBCXX_VERSION_INCLUDED
|
||||
|
||||
#pragma GCC system_header
|
||||
// To facilitate testsuite/17_intro/versionconflict.cc
|
||||
#ifndef _GLIBCXX_TESTING_SYSHDR
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#include <bits/c++config.h>
|
||||
|
||||
|
|
7
libstdc++-v3/testsuite/17_intro/versionconflict.cc
Normal file
7
libstdc++-v3/testsuite/17_intro/versionconflict.cc
Normal file
|
@ -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>
|
Loading…
Add table
Reference in a new issue