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

ICE on concept with member function call that lacks parentheses #52905

Closed
TmLev opened this issue Dec 28, 2021 · 4 comments
Closed

ICE on concept with member function call that lacks parentheses #52905

TmLev opened this issue Dec 28, 2021 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior concepts C++20 concepts

Comments

@TmLev
Copy link
Member

TmLev commented Dec 28, 2021

MRE: https://godbolt.org/z/Kdsoz1eGP

Code for indexing:

#include <concepts>
#include <vector>

template <class T>
concept Beginable = requires(T t) {
    { t.begin } -> std::convertible_to<typename T::iterator>;
    // ^~~  should be `t.begin()`
};

static_assert(Beginable<std::vector<int>>);
@ChuanqiXu9
Copy link
Member

A reduced example: https://godbolt.org/z/ebr9YTbdr

@ChuanqiXu9
Copy link
Member

This should be fixed in: 8de2d06.

@zero9178 zero9178 reopened this Dec 29, 2021
@Quuxplusone Quuxplusone added the concepts C++20 concepts label Jan 16, 2022
@EugeneZelenko EugeneZelenko added bug Indicates an unexpected problem or unintended behavior and removed new issue labels Jan 19, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 19, 2022

@llvm/issue-subscribers-bug

@Quuxplusone
Copy link
Contributor

I have an alternative fix for this at https://reviews.llvm.org/D118552

Quuxplusone added a commit that referenced this issue Feb 1, 2022
Bug #52905 was originally papered over in a different way, but
I believe this is the actually proper fix, or at least closer to
it. We need to detect placeholder types as close to the front-end
as possible, and cause them to fail constraints, rather than letting
them persist into later stages.

Fixes #52905.
Fixes #52909.
Fixes #53075.

Differential Revision: https://reviews.llvm.org/D118552
ahatanaka pushed a commit to apple/llvm-project that referenced this issue May 26, 2022
Bug llvm#52905 was originally papered over in a different way, but
I believe this is the actually proper fix, or at least closer to
it. We need to detect placeholder types as close to the front-end
as possible, and cause them to fail constraints, rather than letting
them persist into later stages.

Fixes llvm#52905.
Fixes llvm#52909.
Fixes llvm#53075.

Differential Revision: https://reviews.llvm.org/D118552

(cherry picked from commit f6ce456)
ahatanaka added a commit to apple/llvm-project that referenced this issue May 27, 2022
…4758)

Bug llvm#52905 was originally papered over in a different way, but I believe this is the actually proper fix, or at least closer to it. We need to detect placeholder types as close to the front-end as possible, and cause them to fail constraints, rather than letting them persist into later stages.

Fixes llvm#52905.
Fixes llvm#52909.
Fixes llvm#53075.

Differential Revision: https://reviews.llvm.org/D118552

(cherry picked from commit f6ce456)

Co-authored-by: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior concepts C++20 concepts
Projects
Status: No status
Development

No branches or pull requests

6 participants