diff options
author | Erich Keane <erich.keane@intel.com> | 2019-05-31 15:56:27 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2019-05-31 15:56:27 +0000 |
commit | 24016eb3746636448ceb1ad6f01b62be4ab00e56 (patch) | |
tree | a7e88e7c8b72b2de045dd3eff8a6629a5b0aac43 /clang/test/SemaCXX/nothrow-vs-exception-specs.cpp | |
parent | 7477fcd93a8c5492f8a4a8bef2985c0e656ec396 (diff) | |
download | bcm5719-llvm-24016eb3746636448ceb1ad6f01b62be4ab00e56.tar.gz bcm5719-llvm-24016eb3746636448ceb1ad6f01b62be4ab00e56.zip |
Suppress nothrow/exception spec conflict warning when ES is parsed.
The previously added warning ended up causing false positives when
nothrow was used on member functions, where the exception specification
wasn't yet parsed. So, throw() and noexcept(true) both were incorrectly
warning. There doesn't seem to be a good way to force these to be parsed
to identify which they are (and likely should not be), so suppress the warning.
For now, unevaluated/uninstantiated are left as warnings as I am not
creative enough to find a reproducer that causes a false positive for
either.
llvm-svn: 362236
Diffstat (limited to 'clang/test/SemaCXX/nothrow-vs-exception-specs.cpp')
-rw-r--r-- | clang/test/SemaCXX/nothrow-vs-exception-specs.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/nothrow-vs-exception-specs.cpp b/clang/test/SemaCXX/nothrow-vs-exception-specs.cpp index f9bc90e30ed..563f6040670 100644 --- a/clang/test/SemaCXX/nothrow-vs-exception-specs.cpp +++ b/clang/test/SemaCXX/nothrow-vs-exception-specs.cpp @@ -53,3 +53,16 @@ __declspec(nothrow) void foo4() noexcept(noexcept(foo1())); __declspec(nothrow) void foo5() noexcept(noexcept(foo2())); // expected-warning@+1{{'nothrow' attribute conflicts with exception specification; attribute ignored}} __declspec(nothrow) void foo6() noexcept(noexcept(foo3())); + +// FIXME: It would be nice to be able to warn on these, however at the time we +// evaluate the nothrow, these have yet to be parsed, so the data is not yet +// there. +struct S { + __declspec(nothrow) void f1(); +#ifndef CPP17 + __declspec(nothrow) void f2() throw(); + __declspec(nothrow) void f3() throw(int); +#endif + __declspec(nothrow) void f4() noexcept(true); + __declspec(nothrow) void f5() noexcept(false); +}; |