Re: Syntax error in type_traits
On Thu, Jan 16, 2025 at 12:38:29 +0100, Jesper Dybdal wrote:
> There is a syntax error (an erroneous ">" character) in
> /usr/include/c++/12/type_traits
> in Bookworm. So compiling any program that includes the <string> header
> fails:
>
> echo "#include <string>" >error.cpp
> g++ -c error.cpp
>
> Results in:
>
> > In file included from /usr/include/c++/12/bits/char_traits.h:42,
> > from /usr/include/c++/12/string:40,
> > from error.cpp:1:
> > /usr/include/c++/12/type_traits:2614:11: error: expected identifier
> > before ‘>’ token
> > 2614 | using >enable_if_t = typename enable_if<_Cond, _Tp>::type;
> > | ^
This is not the case on my bookworm system (Debian 12.9, libstdc++-12-dev
package version 12.2.0-14).
hobbit:~$ sed -n 2614p /usr/include/c++/12/type_traits
using enable_if_t = typename enable_if<_Cond, _Tp>::type;
What version of the libstdc++-12-dev package do you have?
Does reinstalling that package fix the file?
Honestly, it's hard to imagine that this bug wouldn't have been caught,
if it were widespread. I have to think that hundreds of people compile
C++ programs with <string> on Debian every day.
This feels more like a local file modification to me (either by human
error, or file corruption, though the latter seems unlikely as well,
since this is an *added* character, not a modified character).
Reply to: