[patch] Don't assert when calling a pure method with exception spec of a template class

Nico Weber thakis at chromium.org
Wed Aug 20 20:08:28 PDT 2014


Ping :-)


On Sat, Aug 16, 2014 at 10:24 PM, Nico Weber <thakis at chromium.org> wrote:

> Hi,
>
> clang  currently asserts on the following program when building with
> -std=c++11 (PR19190):
>
>   template <class T> struct DWFIterator { virtual T &get() throw(int) = 0;
> };
>   void foo(DWFIterator<int> *foo) { foo->get(); }
>
> This is because in C++11, instantiation of exception specs is deferred.
> This usually happens in MarkFunctionReferenced(), but that's never called
> for pure functions. So the exception spec stays unresolved, and codegen
> then complains about that. (See the bug for details.)
>
> The attached patch lets Sema::MarkAnyDeclReferenced()
> call ResolveExceptionSpec() for non-OdrUse functions. This fixes the assert
> and passes all tests, but I'm not sure if it's the best place to do this –
> hence, pre-commit review, please :-)
>
> Nico
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140820/3dcd650e/attachment.html>


More information about the cfe-commits mailing list