mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-01 20:36:06 +00:00

Sema::InstantiateClass should check only exception specs added during class instantiation and ignore already present delayed specs. This fixes a case where we instantiate a class before parsing member initializers, check exceptions for a different class and fail to find a member initializer. Which is required for comparing exception specs for explicitly-defaulted and implicit default constructor. With the fix we are still checking exception specs but only after member initializers are present. Removing errors in crash-unparsed-exception.cpp is acceptable according to discussion in PR24000 because other compilers accept code in crash-unparsed-exception.cpp as valid. rdar://problem/34167492 Reviewers: davide, rsmith Reviewed By: rsmith Subscribers: dim, cfe-commits Differential Revision: https://reviews.llvm.org/D37881 llvm-svn: 313906
19 lines
293 B
C++
19 lines
293 B
C++
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify -fcxx-exceptions -fexceptions %s
|
|
// expected-no-diagnostics
|
|
|
|
struct A {
|
|
virtual ~A();
|
|
};
|
|
template <class>
|
|
struct B {};
|
|
struct C {
|
|
template <typename>
|
|
struct D {
|
|
~D() throw();
|
|
};
|
|
struct E : A {
|
|
D<int> d;
|
|
};
|
|
B<int> b;
|
|
};
|