-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue
Description
Very surprised to see that:
class S {
~S()=default;
};
int main(){
S *ss = new S[100];
}
This is rejected by clang:
<source>:7:17: error: temporary of type 'S' has private destructor
7 | S *ss = new S[100];
| ^
<source>:2:3: note: implicitly declared private here
2 | ~S()=default;
| ^
I wonder if I have missed some instructions on the standard, but it appears that other compilers including GCC, MSVC and EDG can normally accept it.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issueDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue