https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108244

            Bug ID: 108244
           Summary: [12/13 Regression] Cannot preprocess standard
                    <algorithm> header with -E -fdirectives-only
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gwhitneycom5 at pobox dot com
  Target Milestone: ---

Create a file `algoproblem.cxx` containing just:

```
#include <algorithm>
int main() { return 0; }
```

Now `g++-13 -E -fdirectives-only algoproblem.cxx` fails with:

```
In file included from /usr/include/c++/13/bits/stl_pair.h:60,
                 from /usr/include/c++/13/bits/stl_algobase.h:64,
                 from /usr/include/c++/13/algorithm:60,
                 from algoproblem.cxx:1:
/usr/include/c++/13/type_traits:2948:25: error: missing binary operator before
token "("
 2948 |                bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
      |
```

whereas `g++-12 -E -fdirectives-only algoproblem.cxx` runs to completion,
producing plausible output.

Context: I am running the build2 build system, which separates partial
preprocessing with `-E -fdirectives-only` from the main compilation. Thus,
build2 has broken when trying to switch to g++-13. I am running on an OpenSUSE
Tumbleweed linux installation, reasonably up-to-date, and `g++-13 --version`
reports:

```
g++-13 (SUSE Linux) 13.0.0 20221213 (experimental) [revision
0a43f7b1a73c8e3b9cefffe430274d0a3d6d3291]
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

Reply via email to