[Sema] Prevent InstantiateClass from checking unrelated exception specs.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313906 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit dab9c6a032f9d4fd23f712a8745e3691fab15fa1)
4 files changed