Debian Codegraph @

libstdc++-v3/testsuite/17_intro/headers/c++1998/stdc++_assert_neg.cc

raw
1 // { dg-do compile }
2 // { dg-options "-D_GLIBCXX_NO_ASSERT" }
3 // { dg-require-effective-target hosted }
4 // NB: This is done to force any generated and possibly included PCH
5 // to be invalid, and also to remove cassert from the include set.
6
7 // 2005-05-24 bkoz
8
9 // Copyright (C) 2005-2025 Free Software Foundation, Inc.
10 //
11 // This file is part of the GNU ISO C++ Library. This library is free
12 // software; you can redistribute it and/or modify it under the
13 // terms of the GNU General Public License as published by the
14 // Free Software Foundation; either version 3, or (at your option)
15 // any later version.
16
17 // This library is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21
22 // You should have received a copy of the GNU General Public License along
23 // with this library; see the file COPYING3. If not see
24 // <http://www.gnu.org/licenses/>.
25
26 // 17.4.1.2 Headers
27
28 // This file tests that assert is not included in any of the standard
29 // includes by accident.
30
31 #include <bits/stdc++.h>
32
33 void foo()
34 {
35 assert(true); // { dg-error "not declared" }
36 }