[cfe-dev] Detect if a CXXConstructExpr is implicit

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 12 09:27:27 PST 2019


Ah, I see.  I got lost in the pronoun game :)  

None that I'm aware of, and I don't see anything promising here: https://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html

Perhaps someone with more knowledge of this can elaborate better.

-----Original Message-----
From: Loïc Joly [mailto:loic.actarus.joly at numericable.fr] 
Sent: Tuesday, February 12, 2019 9:18 AM
To: Keane, Erich <erich.keane at intel.com>; Clang Dev <cfe-dev at lists.llvm.org>
Subject: Re: [cfe-dev] Detect if a CXXConstructExpr is implicit

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