[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Syntax error in type_traits




On 2025-01-16 13:07, Greg Wooledge wrote:
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?
jd@nuser:~$ apt list libstdc++-12-dev
libstdc++-12-dev/stable,now 12.2.0-14 amd64 [installed,automatic]
Does reinstalling that package fix the file?
Yes, it does!
!

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.
I was quite surprised too - glad  to hear that others do not have that problem.
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).
Exactly

I could have sworn that I verified yesterday that that header file had modification and change times that seemed plausible together with those of other files there.  But this morning (before the reinstall) it has a modification time of yesterday at 21:50.  And the directory has that same time also, but no other files there have been modified.

But how I can have managed to add a byte in that file beats me.  I didn't even know that there was a file with that name, and I had not been near the directory before I saw the error message. And I had certainly not had it open in an editor.

And about an hour ago, when I checked the file times, the other files in that directory had different, but old times (several with the same time, and several with other "same times"),  But now, after the reinstall, they all have 2023-01-08 as modification time.

There is obviously nothing wrong with the package.  Sorry for bothering you all.

But I am deeply confused about what is happening to my system. 

Thanks to you and Andy,
Jesper
-- 
Jesper Dybdal
https://www.dybdal.dk

Reply to: