-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
[Clang][concepts] Conditional explicit
specifier is checked too early in constrained constructor
#59827
Comments
@llvm/issue-subscribers-c-20 |
@llvm/issue-subscribers-clang-frontend |
I believe the key wording here is [over.match.funcs.general]/8: "... If a constructor template or conversion function template has an explicit-specifier whose constant-expression is value-dependent ([temp.dep]), template argument deduction is performed first and then, if the context admits only candidates that are not explicit and the generated specialization is explicit ([dcl.fct.spec]), it will be removed from the candidate set. ..." Also, I think the repro could be a bit cleaner (https://godbolt.org/z/sszb5z5ha): template<class> constexpr bool always_false = false;
template<class T> concept False = always_false<T>;
template<class X>
constexpr bool do_not_instantiate() {
static_assert(always_false<X>);
return true;
}
struct T {
template<False X>
explicit(do_not_instantiate<X>()) T(X) { }
T(int) { }
};
T t(5);
|
Note that it makes clang-17 unable to compile a lot of code with the libstdc++ distributed with GCC 13. You can reproduce by trying to compile |
CC @erichkeane |
i've been hacking on this weeks ago. Currently I partially instantiate the constructor decl (without instantiate the explicit specifier) and mutate the AST via |
I think that seams reasonable. I believe there is a version of the exception specifier 'storage' that allows us to have uninstantiated exception specifiers in place, and I think we should be able to use that. It might 'just work' after that, since i think later lookups/uses of these check and instantiate that. |
This issue is about explicit specifier but not exception specifier. Did I miss anything here? |
Woops, nope, I think I did. I don't have a good idea here unfortunately on how to give advise then, but what you said in your post at least seems promising. |
…t checking completes (#70548) Modifications: - Skip the instantiation of the explicit-specifier during Decl substitution if we are deducing template arguments and the explicit-specifier is value dependent. - Instantiate the explicit-specifier after the constraint checking completes. - Make `instantiateExplicitSpecifier` a member function in order to instantiate the explicit-specifier in different stages. This PR doesn’t defer the instantiation of the explicit specifier for deduction guides, because I’m not familiar with deduction guides yet. I’ll dig into it after this PR. According to my local test, GCC 13 tuple works with this PR. Fixes #59827. --------- Co-authored-by: Erich Keane <[email protected]>
…t checking completes (llvm#70548) Modifications: - Skip the instantiation of the explicit-specifier during Decl substitution if we are deducing template arguments and the explicit-specifier is value dependent. - Instantiate the explicit-specifier after the constraint checking completes. - Make `instantiateExplicitSpecifier` a member function in order to instantiate the explicit-specifier in different stages. This PR doesn’t defer the instantiation of the explicit specifier for deduction guides, because I’m not familiar with deduction guides yet. I’ll dig into it after this PR. According to my local test, GCC 13 tuple works with this PR. Fixes llvm#59827. --------- Co-authored-by: Erich Keane <[email protected]>
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. Signed-off-by: Kefu Chai <[email protected]>
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. Signed-off-by: Kefu Chai <[email protected]>
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. Signed-off-by: Kefu Chai <[email protected]> Closes scylladb#2058 [avi: regenerate toolchain]
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. since we now install `clang-tools-18`, circleci is updated to build C++20 module with clang-18. as clang-tools-18 provides clang-scan-deps. Signed-off-by: Kefu Chai <[email protected]> Closes scylladb#2058 [avi: regenerate toolchain]
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. since we now install `clang-tools-18`, circleci is updated to build C++20 module with clang-18. as clang-tools-18 provides clang-scan-deps. Signed-off-by: Kefu Chai <[email protected]> Closes scylladb#2058 [avi: regenerate toolchain]
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. Signed-off-by: Kefu Chai <[email protected]>
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. since we now install `clang-tools-18`, circleci is updated to build C++20 module with clang-18. as clang-tools-18 provides clang-scan-deps. Signed-off-by: Kefu Chai <[email protected]> Closes scylladb#2058 [avi: regenerate toolchain]
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. Signed-off-by: Kefu Chai <[email protected]>
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. since we now install `clang-tools-18`, circleci is updated to build C++20 module with clang-18. as clang-tools-18 provides clang-scan-deps. Signed-off-by: Kefu Chai <[email protected]> Closes scylladb#2058 [avi: regenerate toolchain]
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. since we now install `clang-tools-18`, circleci is updated to build C++20 module with clang-18. as clang-tools-18 provides clang-scan-deps. Signed-off-by: Kefu Chai <[email protected]> Closes #2058 [avi: regenerate toolchain]
to address the build failure caused by llvm/llvm-project#59827, and to test the build with C++23, we need to use clang-18. which will be released in March 2023. since we now install `clang-tools-18`, circleci is updated to build C++20 module with clang-18. as clang-tools-18 provides clang-scan-deps. Signed-off-by: Kefu Chai <[email protected]> Closes scylladb#2058 [avi: regenerate toolchain]
There is a bug with libstdc++13 in 24.04: llvm/llvm-project#59827
There is a bug with libstdc++13 in 24.04: llvm/llvm-project#59827
There is a bug with libstdc++13 in 24.04: llvm/llvm-project#59827
Repro (3rd version, 2nd version reproduced other possible bug; see edit history):
Expected: correct compilation
Got:
Compiler explorer: https://godbolt.org/z/sPsGh46Gs
Discovered in: microsoft/STL#3323
The text was updated successfully, but these errors were encountered: