From 0423b76be13eeca6663d278a636e1cb963da3091 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 25 Jun 2013 01:24:22 +0000 Subject: Fix noexcept for delete expressions. Using "delete" on a pointer to an incomplete type can't throw. While I'm here, clean up the signature of the canCalleeThrow() helper. llvm-svn: 184810 --- clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/test/CXX/expr/expr.unary/expr.unary.noexcept') diff --git a/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp b/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp index 1f5969d4932..33388cf3109 100644 --- a/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp +++ b/clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 -fms-extensions %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 -fms-extensions -Wno-delete-incomplete %s // expected-no-diagnostics #define P(e) static_assert(noexcept(e), "expected nothrow") @@ -91,6 +91,8 @@ struct S2 { void *operator new(__typeof__(sizeof(int)) sz, int) throw(); +struct IncompleteStruct; + struct Bad1 { ~Bad1() throw(int); }; @@ -104,6 +106,7 @@ void implicits() { N(new int); P(new (0) int); P(delete (int*)0); + P(delete (IncompleteStruct*)0); N(delete (Bad1*)0); N(delete (Bad2*)0); N(S2()); -- cgit v1.2.3