Clang does not realize inaccessible user-defined operator delete
until it is called
#121645
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
diverges-from:edg
Does the clang frontend diverge from edg compiler
diverges-from:gcc
Does the clang frontend diverge from gcc on this issue
diverges-from:msvc
Does the clang frontend diverge from msvc on this issue
Consider the following code:
It appears that clang does not complain about anything about the private
operator delete
ofQcacheT
when it is dynamically instantiated. Only when the operator is explicitly called will the compiler reject the code. However, there is no need to do so in GCC, EDG, and MSVC:https://godbolt.org/z/rvs1bjavh
Considering that clang will also reject the code without explicit calling of
operator delete
when it defaults, it seems to be more like a bug of clang:https://godbolt.org/z/8oso11haf
The text was updated successfully, but these errors were encountered: