[cfe-dev] Detect if a CXXConstructExpr is implicit

Loïc Joly via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 12 09:18:07 PST 2019


Le 12/02/2019 à 17:50, Keane, Erich a écrit :
> If you look at the AST for the record decl, there is a bunch of flags in the DefinitionData of interest:
> |-CXXRecordDecl <line:1:1, line:6:1> line:1:7 referenced class A
> |definition
> | |-DefinitionData empty standard_layout has_user_declared_ctor
> | |can_const_default_init
> | | |-DefaultConstructor exists non_trivial user_provided
> | | |defaulted_is_constexpr -CopyConstructor non_trivial user_declared
> | | |has_const_param implicit_has_const_param -MoveConstructor
> | | |-CopyAssignment trivial has_const_param needs_implicit
> | | |implicit_has_const_param -MoveAssignment
>
> See "user_provided" and "user_declared".  I'm not sure what the difference between those two is however.

Unless I'm mistaken, those notions apply to CXXContructorDecl, not to 
CXXConstructExpr. A user declared copy constructor may or may not be 
called implicitely.


---
Loïc Joly






More information about the cfe-dev mailing list