[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

Nicolas Lesser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 5 03:28:43 PDT 2019


Rakete1111 added a comment.

Is this also okay?

  main.cpp:2:9: warning: lambda expressions are incompatible with C++98 [-Wc++98-compat]
    delete[] { return new int; }
          ^
  main.cpp:2:3: error: '[]' after delete interpreted as 'delete[]'; add parentheses to treat this as a lambda-expression
    delete[] { return new int; }
    ^~~~~~~~
          (                     )


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D36357/new/

https://reviews.llvm.org/D36357





More information about the cfe-commits mailing list