From 8bf410fafae2496f48578fad0bee9a6503693d1b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 27 Aug 2014 17:04:39 +0000 Subject: Call ResolveExceptionSpec for non-OdrUsed functions. In C++11, instantiation of exception specs is deferred. The instantiation is done in MarkFunctionReferenced(), which wasn't called for non-OdrUsed functions, which then caused an assert in codegen. Fixes PR19190, see the bug for details. llvm-svn: 216562 --- clang/test/CodeGenCXX/cxx11-exception-spec.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/test/CodeGenCXX/cxx11-exception-spec.cpp') diff --git a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp index 3b1516b9253..75f939f93f0 100644 --- a/clang/test/CodeGenCXX/cxx11-exception-spec.cpp +++ b/clang/test/CodeGenCXX/cxx11-exception-spec.cpp @@ -122,3 +122,8 @@ void j() { // CHECK: attributes [[NONE]] = { {{.*}} } // CHECK: attributes [[NUW]] = { nounwind{{.*}} } + +namespace PR19190 { +template struct DWFIterator { virtual void get() throw(int) = 0; }; +void foo(DWFIterator *foo) { foo->get(); } +} -- cgit v1.2.3