[C++ PATCH] simplify clone predicate

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[C++ PATCH] simplify clone predicate

Nathan Sidwell-2
This patch replaces the decl_cloned_function_p function call with simpler macro
uses.  As only cdtors are cloned, we can use IDENTIFIER_CDTOR_P to check.

In the process I discovered the documentation had bitrotted -- we were giving
non-function_decls to the predicate, sometimes intentionally (template_decls),
and sometimes unintentionally (record_types).  The new semantics are we can give
  any _decl to the predicate and only function_decls to the accessor.  The
change in pt.d is because at namespace scope, we chain record_types (&enums &
unions) on the chain list.  Previously that was harmless but now causes the
predicate to assert.

Applying to trunk.

nathan
--
Nathan Sidwell

clone-1.diff (4K) Download Attachment