This is an archive of the discontinued LLVM Phabricator instance.

[SemaTemplate] Detect instantiation of unparsed exceptions
ClosedPublic

Authored by davide on Jul 19 2015, 10:45 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

davide updated this revision to Diff 30120.Jul 19 2015, 10:45 AM
davide retitled this revision from to [SemaTemplate] Detect instantiation of unparsed exceptions.
davide updated this object.
davide added a reviewer: rsmith.
davide added subscribers: dim, cfe-commits.
dim added a comment.Jul 24 2015, 4:49 AM

For fixing bug 24000, this patch works. Before the patch:

clang -std=c++11 -c pr24000.cpp
Assertion failed: (EST == EST_Dynamic && "EST case not considered earlier."), function CalledDecl, file /share/dim/src/llvm/trunk/tools/clang/lib/Sema/SemaDeclCXX.cpp, line 208.

After the patch:

clang -std=c++11 -c pr24000.cpp
pr24000.cpp:12:12: error: exception specification is not available until end of class definition
    D<int> d;
           ^
pr24000.cpp:14:10: note: in instantiation of template class 'B<int>' requested here
  B<int> b;
         ^
1 error generated.

This also works correctly for the FreeBSD devel/codeblocks port, which now results in this (expected) error:

In file included from cbthreadpool.cpp:18:
../../src/include/cbthreadpool.h:140:33: error: exception specification is not available until end of class definition
        CountedPtr<wxSemaphore> m_semaphore;
                                ^

Thanks for testing Dimitry, I'll try to get this in LLVM and FreeBSD after sign-off from Richard.

rsmith accepted this revision.Jul 24 2015, 1:02 PM
rsmith edited edge metadata.

Thanks, LGTM.

This revision is now accepted and ready to land.Jul 24 2015, 1:02 PM
This revision was automatically updated to reflect the committed changes.