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

IntelliSense hover and inlay hints incorrect reports type "unnamed" instead of "const float&" #12961

Open
sean-mcmanus opened this issue Nov 13, 2024 · 1 comment
Labels
bug Feature: Hover (Quick Info) An issue related to Hover (Quick Info) Feature: Inlay Hint An issue related to inlay hints for declarations and parameters. Language Service Visual Studio Inherited from Visual Studio
Milestone

Comments

@sean-mcmanus
Copy link
Collaborator

Repro code is

#include <array>

template <std::size_t N>
constexpr auto transform(const std::array<float, N>& arr)
{
    std::array<int, N> values;
    for (std::size_t i{0}; const auto& k : arr)
    {
        static_assert(std::is_same_v<decltype(k), const float&>);
        constexpr auto j = 0;
        values[j] = k;  // change this j to i and you get a different error as well
        ++i;
    }
    return values;
}

int main()
{
    constexpr auto values = transform(std::array{0.f});
}

using C++ 20. Based on the repro in #8673 .

VS screenshot:
Image

@sean-mcmanus sean-mcmanus added bug Language Service Visual Studio Inherited from Visual Studio labels Nov 13, 2024
@sean-mcmanus sean-mcmanus added this to the Tracking milestone Nov 13, 2024
@sean-mcmanus sean-mcmanus added Feature: Inlay Hint An issue related to inlay hints for declarations and parameters. Feature: Hover (Quick Info) An issue related to Hover (Quick Info) labels Nov 13, 2024
@sean-mcmanus
Copy link
Collaborator Author

I've filed a VS bug at https://developercommunity.visualstudio.com/t/C-IntelliSense-hover-and-inlay-hints-i/10789337 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature: Hover (Quick Info) An issue related to Hover (Quick Info) Feature: Inlay Hint An issue related to inlay hints for declarations and parameters. Language Service Visual Studio Inherited from Visual Studio
Projects
Status: No status
Development

No branches or pull requests

1 participant