================
@@ -7,8 +7,9 @@ void *operator new(size_t); // #new_decl
struct Tag {};
void f() {
- int *p = new (Tag{}) int[4];
- // expected-error@-1 {{no matching function for call to 'operator new'}}
+ int *p = new (Tag{}) int[4]; // #new_expr
+ // expected-error@#new_expr {{no matching function for call to 'operator
new[]'}}
// expected-note@#new_decl {{candidate function not viable: requires 1
argument, but 2 were provided}}
+ // expected-note@#new_expr {{MSVC compatibility fall back to 'operator new'
failed}}
----------------
igorkudrin wrote:
Isn't this even more confusing? With this change, it now reads like the
compiler tried to find 'operator new[]' but looked only through 'operator new',
and failed.
I believe that if the MSVC compatibility fallback failed, the diagnostics
should print notes for 'operator new[]' in the first place.
https://github.com/llvm/llvm-project/pull/211482
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits