patchGNU source-highlight - Patches: patch #10135, Fix build on gcc-12 and clang


You are not allowed to post comments on this tracker with your current authentication level.

patch #10135: Fix build on gcc-12 and clang

Submitter:  Sergei Trofimovich <slyfox>
Submitted:  Mon 08 Nov 2021 11:31:58 PM UTC
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Sun 29 Jan 2023 03:40:07 PM UTC, comment #1: 

This was fixed.

Tom Tromey <tromey>
Group administrator
Mon 08 Nov 2021 11:31:58 PM UTC, original submission:  

Both gcc-12 and clang can't find ostream<<(..., std::pair<...>)
overload when compile lib/tests/test_wordtokenizer_main.cpp and
fail as:

    error no match for «operator<<» (operand types are «std::ostringstream»
      {aka «std::__cxx11::basic_ostringstream<char>»}
      and «const std::pair<std::__cxx11::basic_string<char>,
                           std::__cxx11::basic_string<char> >»)
      103 |     buf << (*it);
          |     ~~~~^~~~~~~~

We fix it by placing overload to std namespace where std::pair<...>
is defined to make ADL work predictably.

clang also has a trouble compiling lib/tests/stdboosterror.h as:

    ./stdboosterror.h:7:72: error: parameter declarator cannot be qualified

gcc compiles it by accident:

Let's disambiguate syntax by making it an explicit constructor call.

Sergei Trofimovich <slyfox>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by tromey (Posted a comment)
  • -email is unavailable- added by slyfox (Submitted the item)
  • -email is unavailable- added by slyfox

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-29 tromey Open/ClosedOpen Closed
    2023-01-29 tromey StatusNone Done
    2021-11-08 slyfox Attached File- Added 0001-Fix-tests-build-failure-on-clang-and-gcc-12.patch, #52225
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code