Skip to content

c++20 std::source_location support request #23254

Closed

Description

@hsdk123

This is a request for a compiler upgrade that supports std::source_location

https://en.cppreference.com/w/cpp/utility/source_location

Activity

  1. changed the title [-]c++20 std::source_location[/-] [+]c++20 std::source_location support request[/+] on Dec 26, 2024
  2. sbc100 commented on Dec 31, 2024

    @sbc100
    Collaborator

    This sounds like a libc++ issue? What happens if you try to use this feature with emscripten today? Perhaps the upcoming change to upgrade libc++ to LLVM 19 will fix this: #22994 ?

  3. hsdk123 commented on Jan 1, 2025

    @hsdk123
    Author

    What happens if you try to use this feature with emscripten today?

    A compiler error that the header source_location doesn't exist.

  4. sbc100 commented on Jan 2, 2025

    @sbc100
    Collaborator

    Seems to work for me:

    $ cat test.cc 
    #include <source_location>
    
    std::source_location x;
    $ em++ -std=c++20 test.cc -c
    

    Can you share the full command line you are using? And also the version of emscripten you are using?

  5. hsdk123 commented on Jan 25, 2025

    @hsdk123
    Author

    @sbc100
    Thanks for the replies! I've realised this was because I hadn't properly enabled c++20.
    Once enabling c++20 though, I run into the error here, hence not useable:
    #22305

  6. sbc100 commented on Jan 25, 2025

    @sbc100
    Collaborator

    OK, sounds like we can close this in as duplicate of #22305?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions