mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
libstdc++: remove cassert from stdc++.h
<cassert> isn't suitable for a header unit, because by design it depends on the user NDEBUG macro. So let's not include it in <bits/stdc++.h>. libstdc++-v3/ChangeLog: * include/precompiled/stdc++.h: Remove <cassert>. * testsuite/util/exception/safety.h: Add <cassert>. * testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc: Don't define _GLIBCXX_NO_ASSERT.
This commit is contained in:
@@ -29,9 +29,7 @@
|
||||
// 17.4.1.2 Headers
|
||||
|
||||
// C
|
||||
#ifndef _GLIBCXX_NO_ASSERT
|
||||
#include <cassert>
|
||||
#endif
|
||||
// Don't include cassert, it's not suitable for PCH or header unit.
|
||||
#include <cctype>
|
||||
#include <cfloat>
|
||||
#include <climits>
|
||||
@@ -104,9 +102,6 @@
|
||||
|
||||
#if _GLIBCXX_HOSTED
|
||||
// C
|
||||
#ifndef _GLIBCXX_NO_ASSERT
|
||||
#include <cassert>
|
||||
#endif
|
||||
#include <cctype>
|
||||
#include <cerrno>
|
||||
#include <cfloat>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-D_GLIBCXX_NO_ASSERT" }
|
||||
// { dg-require-effective-target hosted }
|
||||
// NB: This is done to force any generated and possibly included PCH
|
||||
// to be invalid, and also to remove cassert from the include set.
|
||||
|
||||
// 2005-05-24 bkoz
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <ext/throw_allocator.h>
|
||||
#include <cstdlib> // getenv, atoi
|
||||
#include <cstdio> // printf, fflush
|
||||
#include <cassert> // assert
|
||||
|
||||
// Container requirement testing.
|
||||
namespace __gnu_test
|
||||
|
||||
Reference in New Issue
Block a user