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; | ^
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; | ^
/usr/include/c++/12/type_traits:2614:11: error: expected
unqualified-id before ‘>’ token
In file included from /usr/include/c++/12/bits/refwrap.h:38, from /usr/include/c++/12/string:51: /usr/include/c++/12/bits/invoke.h:103:15: error: ‘enable_if_t’ does
not name a type; did you mean ‘enable_if’?
103 | constexpr enable_if_t<is_invocable_r_v<_Res, _Callable, _Args...>, _Res>
enable_if_t = ") is removed.
jd@nuser:~$ cat /etc/debian_version
12.9
jd@nuser:~$ g++ --version
g++ (Debian 12.2.0-14) 12.2.0
jd@nuser:~$ ldd --version
ldd (Debian GLIBC 2.36-9+deb12u9) 2.36
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; | ^
/usr/include/c++/12/type_traits:2614:11: error: expected
unqualified-id before ‘>’ token
In file included from /usr/include/c++/12/bits/refwrap.h:38, from /usr/include/c++/12/string:51: /usr/include/c++/12/bits/invoke.h:103:15: error: ‘enable_if_t’ does
not name a type; did you mean ‘enable_if’?
103 | constexpr enable_if_t<is_invocable_r_v<_Res, _Callable, _Args...>, _Res>
| ^~~~~~~~~~~
| enable_if
In file included from /usr/include/c++/12/string:53: /usr/include/c++/12/bits/basic_string.h:155:24: error: ‘enable_if_t’
does not name a type; did you mean ‘enable_if’?
155 | using _If_sv = enable_if_t<
| ^~~~~~~~~~~ | enable_if /usr/include/c++/12/bits/basic_string.h:772:27: error: ‘enable_if_t’
does not name a type; did you mean ‘enable_if’?
772 | typename = enable_if_t<is_convertible_v<const
_Tp&, __sv_type>>>
| ^~~~~~~~~~~ | enable_if /usr/include/c++/12/bits/basic_string.h:772:38: error: expected ‘>’ before ‘<’ token
772 | typename = enable_if_t<is_convertible_v<const
_Tp&, __sv_type>>>
| ^
/usr/include/c++/12/bits/basic_string.h:783:41: error: ‘_If_sv’ does
not name a type
783 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~
/usr/include/c++/12/bits/basic_string.h:783:47: error: expected ‘>’ before ‘<’ token
783 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^
/usr/include/c++/12/bits/basic_string.h:927:8: error: ‘_If_sv’ does
not name a type
927 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:1375:9: error: ‘_If_sv’ does
not name a type
1375 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:1492:9: error: ‘_If_sv’ does
not name a type
1492 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:1508:9: error: ‘_If_sv’ does
not name a type
1508 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:1704:9: error: ‘_If_sv’ does
not name a type
1704 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:1720:9: error: ‘_If_sv’ does
not name a type
1720 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:1986:9: error: ‘_If_sv’ does
not name a type
1986 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2003:9: error: ‘_If_sv’ does
not name a type
2003 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2439:9: error: ‘_If_sv’ does
not name a type
2439 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2457:9: error: ‘_If_sv’ does
not name a type
2457 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2479:9: error: ‘_If_sv’ does
not name a type
2479 | _If_sv<_Tp, basic_string&>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2633:9: error: ‘_If_sv’ does
not name a type
2633 | _If_sv<_Tp, size_type>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2699:9: error: ‘_If_sv’ does
not name a type
2699 | _If_sv<_Tp, size_type>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2784:9: error: ‘_If_sv’ does
not name a type
2784 | _If_sv<_Tp, size_type>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2873:9: error: ‘_If_sv’ does
not name a type
2873 | _If_sv<_Tp, size_type>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:2960:9: error: ‘_If_sv’ does
not name a type
2960 | _If_sv<_Tp, size_type>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:3048:9: error: ‘_If_sv’ does
not name a type
3048 | _If_sv<_Tp, size_type>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:3162:9: error: ‘_If_sv’ does
not name a type
3162 | _If_sv<_Tp, int>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:3187:9: error: ‘_If_sv’ does
not name a type
3187 | _If_sv<_Tp, int>
| ^~~~~~ /usr/include/c++/12/bits/basic_string.h:3207:9: error: ‘_If_sv’ does
not name a type
3207 | _If_sv<_Tp, int>
| ^~~~~~
There is a syntax error (an erroneous ">" character) in
/usr/include/c++/12/type_traits
in Bookworm.
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; | ^
Could someone familiar with the correct way of reporting such things please report this?
jd@nuser:~$ g++ --version
g++ (Debian 12.2.0-14) 12.2.0
On Thu, Jan 16, 2025 at 12:38:29 +0100, Jesper Dybdal wrote:jd@nuser:~$ apt list libstdc++-12-dev
There is a syntax error (an erroneous ">" character) inThis is not the case on my bookworm system (Debian 12.9, libstdc++-12-dev package version 12.2.0-14).
/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;
| ^
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?Yes, it does!
Honestly, it's hard to imagine that this bug wouldn't have been caught,I was quite surprised too - glad to hear that others do not have that problem.
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 humanExactly
error, or file corruption, though the latter seems unlikely as well,
since this is an *added* character, not a modified character).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 04:00:15 |
Calls: | 10,387 |
Calls today: | 2 |
Files: | 14,061 |
Messages: | 6,416,778 |