Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<source_location>: Investigate EDG issues #2859

Closed
StephanTLavavej opened this issue Jul 13, 2022 · 3 comments
Closed

<source_location>: Investigate EDG issues #2859

StephanTLavavej opened this issue Jul 13, 2022 · 3 comments
Labels
compiler Compiler work involved fixed Something works now, yay!

Comments

@StephanTLavavej
Copy link
Member

We have a workaround for internal VSO-1285779 "REPORTED: EDG rejects source_location intrinsics within consteval functions" in the test:

#if defined(__cpp_consteval) && !defined(__EDG__) // TRANSITION, VSO-1285779

This was resolved as fixed on 2021-09-07 by internal VS-PR-348924 in VS 2022 17.0. However, attempting to remove this workaround with VS 2022 17.3 Preview 3 fails with numerous compiler errors. We need to investigate and report these issues.

@StephanTLavavej StephanTLavavej added help wanted Extra attention is needed compiler Compiler work involved labels Jul 13, 2022
@cpplearner
Copy link
Contributor

EDG seems to have trouble computing the correct location.

D:\test>type test-edg-srcloc.cpp
#include <source_location>

template<unsigned> struct A {};

A<std::source_location::current().line()> x = 0;

D:\test>cl /std:c++20 /BE test-edg-srcloc.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.33.31627.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

test-edg-srcloc.cpp
"test-edg-srcloc.cpp", line 5: error: no suitable constructor exists to convert
          from "int" to "A<26U>"
  A<std::source_location::current().line()> x = 0;
                                                ^

Note that it thinks std::source_location::current().line() at line 5 evaluates to 26U, maybe because current is defined at line 26 in <source_location>.

@frederick-vs-ja
Copy link
Contributor

It seems that this issue can be closed as the workaround was removed by #3866.

@StephanTLavavej
Copy link
Member Author

Agreed. All remaining EDG checks in the test are either column number variation (which we don't care about) or are actually guarding an MSVC bug. Thanks!

@StephanTLavavej StephanTLavavej added fixed Something works now, yay! and removed help wanted Extra attention is needed labels Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Compiler work involved fixed Something works now, yay!
Projects
None yet
Development

No branches or pull requests

3 participants