-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuegenerated by fuzzerquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
Description:
I'm seeking clarification on whether the following code is well-formed C++.
GCC accepts it, but Clang rejects it with:
error: cannot allocate function type 'std::nothrow_t ()' with new
Program
#include <new>
int main() {
char* p = new (std::nothrow_t()) char[1];
return 0;
}
Is this a parsing difference, or is one compiler incorrect?
Repro: https://godbolt.org/z/17zfedxds
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"diverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issuegenerated by fuzzerquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!