[cfe-dev] Initializer lists and the AST

Vane, Edwin edwin.vane at intel.com
Fri Feb 1 08:41:53 PST 2013


I have two statements I'm looking at for replacing the type specifier with 'auto':

  std::vector<int>::iterator begin2{blah.begin()};
  std::vector<int>::iterator begin3 = {blah.begin()};

The end result is that the first line should use auto and the second should not (auto will turn into std::initializer_list). However, when I dump the parts of the AST corresponding to the initializers, I get exactly the same thing. How can I differentiate these two cases? Should I be looking in the VarDecl for some clue?

--
Edwin Vane
  Software Developer
  Intel of Canada, Inc.






More information about the cfe-dev mailing list