llvm-project/clang/test/CXX
Richard Smith 883dbc43d9 Switch from using a DiagnosticTrap and a note for "while defining a special
member function" context notes to registering an entry on the context stack.

Also reorder the steps within defining special members to be consistent.

This has a few benefits: if multiple diagnostics are produced while checking
such a member, the note is now attached to the first such diagnostic rather
than the last, this prepares us for persisting these diagnostics between the
point at which we require the implicit instantiation of a template and the
point at which that instantiation is actually performed, and this fixes some
cases where we would fail to produce a full note stack leading back to user
code in the case of such a diagnostic.

The reordering exposed a case where we could recursively attempt to define a
defaulted destructor while we're already defining one (and other such cases
also appear to be possible, with or without this change), so this change also
reuses the "willHaveBody" flag on function declarations to track that we're in
the middle of synthesizing a body for the function and bails out if we try to
define a function that we're already defining.

llvm-svn: 303930
2017-05-25 22:47:05 +00:00
..
basic Print nested name specifiers for typedefs and type aliases 2017-03-10 15:04:58 +00:00
class Fix all tests under test/CXX (and test/Analysis) to pass if clang's default 2016-08-31 23:24:08 +00:00
class.access Switch from using a DiagnosticTrap and a note for "while defining a special 2017-05-25 22:47:05 +00:00
class.derived Add context note to diagnostics that occur while declaring an implicit special member function. 2017-02-23 21:43:43 +00:00
concepts-ts [Concepts] Class template associated constraints 2017-02-10 02:46:19 +00:00
conv [c++1z] P0003R5: Removing dynamic exception specifications. 2016-12-08 02:49:07 +00:00
cpp/cpp.predefined P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we 2016-09-30 22:41:36 +00:00
dcl.dcl Correct class-template deprecation behavior-REDUX 2017-03-23 18:51:54 +00:00
dcl.decl [Sema] Add lvalue-to-rvalue cast in direct-list-initialization of enum 2017-02-16 01:20:00 +00:00
drs [Sema] Implement Core 2094: Trivial copy/move constructor for class with volatile member 2017-05-09 22:21:24 +00:00
except P0012R1: Make exception specifications be part of the type system. This 2016-10-16 17:54:23 +00:00
expr [c++1z] Synthesize implicit deduction guides from constructors on demand. Rank 2017-02-14 00:25:28 +00:00
lex Convert test/CXX/lex/lex.literal/lex.string/p4.cpp back to DOS line 2016-01-04 10:17:48 +00:00
modules-ts [modules ts] Diagnose 'export' declarations outside of a module interface. 2017-04-24 23:12:30 +00:00
over [c++1z] Add some more tests for class template argument deduction, add 2017-02-14 00:55:25 +00:00
special [Sema] Improve the error diagnostic for dot destructor calls on pointer objects 2017-01-20 15:38:58 +00:00
stmt.stmt Try contextually converting condition of constexpr if to Boolean value 2016-09-07 18:24:54 +00:00
temp [c++1z] Add some more tests for class template argument deduction, add 2017-02-14 00:55:25 +00:00