Skip to content

[BUG] inspect expression returning a qualified type generates invalid Cpp1 #724

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

Open
ntrel opened this issue Oct 4, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@ntrel
Copy link
Contributor

ntrel commented Oct 4, 2023

To Reproduce

    s = inspect v -> *const char {
        is _ = "";
    };

Cpp1 has invalid return char const*{}; statements:

        if (cpp2::is(_expr, 0)) { if constexpr( requires{"";} ) if constexpr( std::is_convertible_v<CPP2_TYPEOF(("")),char const*> ) return ""; else return char const*{}; else return char const*{}; }
@ntrel ntrel added the bug Something isn't working label Oct 4, 2023
@JohelEGP
Copy link
Contributor

JohelEGP commented Oct 4, 2023

Actual reproducer (https://cpp2.godbolt.org/z/5TT6zz9rM):

main: () = {
  s = inspect v -> *const char {
    is 0 = "";
    is _ = "";
  };
}

Related: #525.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants