[cfe-dev] clang-tidy check: Uninitialised primitive members in constructors

Richard legalize at xmission.com
Tue Feb 3 11:44:26 PST 2015


In article <2A81C75A-0E4C-448D-A98E-A538EA32DF27 at gmail.com>,
    Jonathan Coe <jonathanbcoe at gmail.com> writes:

> I'm struggling to see how I can find the location for the replacement text.
> I want the start of the initialisers but I don't see how to get a location fo
r that.

>From CXXConstructorDecl::init_begin() you can get the first
initializer.

>From FunctionDecl::parameters() you can get the parameters.

So you should be able to look at the source location of the last
parameter and the source location of the first initializer.  There
doesn't seem to be any function for explicitly locating the ':' that
begins the initializer list, but it will be between the above two
source ranges.
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>



More information about the cfe-dev mailing list