-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Deleted function can return incomplete type #52802
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Comments
poyaoc97
added
the
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
label
Apr 3, 2022
@llvm/issue-subscribers-clang-frontend |
mem-frob
pushed a commit
to draperlaboratory/hope-llvm-project
that referenced
this issue
Oct 7, 2022
According to CWG 1394 and C++20 [dcl.fct.def.general]p2, Clang should not diagnose incomplete types if function body is "= delete;". For example: ``` struct Incomplete; Incomplete f(Incomplete) = delete; // well-formed ``` Also close llvm/llvm-project#52802 Differential Revision: https://reviews.llvm.org/D122981
neobrain
added a commit
to neobrain/FEX
that referenced
this issue
Dec 12, 2023
Returning incomplete types from deleted functions is valid C++, but clang did not support it until version 15: llvm/llvm-project#52802
neobrain
added a commit
to neobrain/FEX
that referenced
this issue
Dec 13, 2023
Returning incomplete types from deleted functions is valid C++, but clang did not support it until version 15: llvm/llvm-project#52802
neobrain
added a commit
to neobrain/FEX
that referenced
this issue
Dec 21, 2023
Returning incomplete types from deleted functions is valid C++, but clang did not support it until version 15: llvm/llvm-project#52802
neobrain
added a commit
to neobrain/FEX
that referenced
this issue
Dec 21, 2023
Returning incomplete types from deleted functions is valid C++, but clang did not support it until version 15: llvm/llvm-project#52802
neobrain
added a commit
to neobrain/FEX
that referenced
this issue
Dec 22, 2023
Returning incomplete types from deleted functions is valid C++, but clang did not support it until version 15: llvm/llvm-project#52802
neobrain
added a commit
to neobrain/FEX
that referenced
this issue
Dec 26, 2023
Returning incomplete types from deleted functions is valid C++, but clang did not support it until version 15: llvm/llvm-project#52802
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following program is valid:
It is accepted by GCC, but rejected by Clang with the error:
which is wrong per https://timsong-cpp.github.io/cppwp/n4868/dcl.fct.def#general-2.sentence-3
Demo: https://gcc.godbolt.org/z/937PEz1h3
Related discussion: https://stackoverflow.com/q/70410542/7325599
The text was updated successfully, but these errors were encountered: