[cfe-commits] r136161 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExprCXX.cpp test/SemaCXX/new-delete.cpp

Chandler Carruth chandlerc at google.com
Tue Jul 26 23:51:51 PDT 2011


On Tue, Jul 26, 2011 at 11:03 PM, John McCall <rjmccall at apple.com> wrote:

> But it's not a pointer to object type.


Yea, I think everyone got confused on this point. The test case clearly
demonstrates what it is this patch makes into an error and I agree it should
be an error.

Specifically, to avoid further confusion, the test cases:

+namespace DeleteIncompleteClass {
+  struct A; // expected-note {{forward declaration}}
+  extern A x;
+  void f() { delete x; } // expected-error {{deleting incomplete class
type}}
+}
Non-pointer, hard error.

+namespace DeleteIncompleteClassPointerError {
+  struct A; // expected-note {{forward declaration}}
+  void f(A *x) { 1+delete x; } // expected-warning {{deleting pointer to
incomplete type}} \
+                               // expected-error {{invalid operands to
binary expression}}
+}
Pointer, and just a warning.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110726/004da7b5/attachment.html>


More information about the cfe-commits mailing list