Giter VIP home page Giter VIP logo

Comments (4)

andreasfertig avatar andreasfertig commented on May 27, 2024

Hello @Ukilele,

thanks for bringing this up.

I don't understand what role std::source_location plays here. You're using the internals required to implement source_location; the STD type works fine as far as I know.

I'm a bit reluctant to implement this transformation. Getting the correct information from SourceLocExpr seems difficult, and I'm unsure about the benefit.

Andreas

from cppinsights.

Ukilele avatar Ukilele commented on May 27, 2024

Hi Andreas,
your welcome!

I just brought up std::source_location because this was the class I originally used when I came accross this issue. I guess that since it's standarized since C++20, its usage might be higher than the one of builtin compiler-intrinsics. For a simplification of the code to reproduce the issue, I switched to __builtin_LINE().
When using std::source_location::current() you will get a similar output:

std::source_location::current(/* INSIGHTS-TODO: CodeGenerator.cpp:3851 stmt: SourceLocExpr */)

I agree that it definitely is no urgent or important issue.

from cppinsights.

andreasfertig avatar andreasfertig commented on May 27, 2024

Hello @Ukilele,

usually I appreciate reduced issue reports, as I did here. Yet, your new std::source_location::current() reminded me of the implementation of source_location. Despite the standard not mentioning it, current takes a parameter of from __builtin_source_location. Looks like I have to act on this one :-)

Andreas

from cppinsights.

Ukilele avatar Ukilele commented on May 27, 2024

Awesome, that was quick :) Thanks a lot 👍

from cppinsights.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.