diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2013-06-25 01:24:22 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2013-06-25 01:24:22 +0000 |
commit | 0423b76be13eeca6663d278a636e1cb963da3091 (patch) | |
tree | 4eee3f92eeae28aaf930ca406d11337ce71564ae /clang/test/CXX/expr/expr.unary | |
parent | 36c17ee5a16ea66f048beaea6ba351708a1a218b (diff) | |
download | bcm5719-llvm-0423b76be13eeca6663d278a636e1cb963da3091.tar.gz bcm5719-llvm-0423b76be13eeca6663d278a636e1cb963da3091.zip |
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
Diffstat (limited to 'clang/test/CXX/expr/expr.unary')
-rw-r--r-- | clang/test/CXX/expr/expr.unary/expr.unary.noexcept/sema.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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()); |