jyu2 added inline comments.
================ Comment at: test/SemaCXX/warn-throw-out-noexcept-func.cpp:1 +// RUN: %clang_cc1 %s -fdelayed-template-parsing -fcxx-exceptions -fexceptions -fsyntax-only -Wexceptions -verify -std=c++11 +struct A { ---------------- aaron.ballman wrote: > aaron.ballman wrote: > > aaron.ballman wrote: > > > Please drop the svn auto props. > > This does not appear to be done. > This file still has the svn auto props. I am so sorry. Remove it. ================ Comment at: test/SemaCXX/warn-throw-out-noexcept-func.cpp:1 +// RUN: %clang_cc1 %s -fdelayed-template-parsing -fcxx-exceptions -fexceptions -fsyntax-only -Wexceptions -verify -std=c++11 +struct A { ---------------- aaron.ballman wrote: > rnk wrote: > > aaron.ballman wrote: > > > I believe you can drop the -fcxx-exceptions as it should be implied by > > > -fexceptions. > > It isn't at the -cc1 level, you need -fcxx-exceptions there. -fexceptions > > controls landingpad cleanup emission. > Ah, thank you Reid, I forgot about that. I can remove -fexceptions, since I only care for syntax. ================ Comment at: test/SemaCXX/warn-throw-out-noexcept-func.cpp:27 +} + +struct N : A { ---------------- aaron.ballman wrote: > Can you add a test case like: > ``` > struct Throws { > ~Throws() noexcept(false); > }; > > struct ShouldDiagnose { > Throws T; > ~ShouldDiagnose() {} > }; > ``` > I would expect `~ShouldDiagnose()` to be diagnosed as allowing exceptions to > escape because of the destructor for `Throws`. In C++11, destructors are implicitly throw() unless any member or base of the type has a destructor with a different exception specification. In the case of: struct Throws { ~Throws() noexcept(false); }; struct ShouldDiagnose { Throws T; ~ShouldDiagnose() {} }; You should not see diagnose for ~ShouldDiagnose() , since ShouldDiagnose has a member ofr Throws which has destructor with noexcept(false); therefor ~ShouldDiagnose has noexcept(false). But I add test case which remove (false) part. https://reviews.llvm.org/D33333 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits