llvm-project/clang/lib/Parse
Douglas Gregor 7ae2d7758f Rework base and member initialization in constructors, with several
(necessarily simultaneous) changes:

  - CXXBaseOrMemberInitializer now contains only a single initializer
    rather than a set of initialiation arguments + a constructor. The
    single initializer covers all aspects of initialization, including
    constructor calls as necessary but also cleanup of temporaries
    created by the initializer (which we never handled
    before!).

  - Rework + simplify code generation for CXXBaseOrMemberInitializers,
    since we can now just emit the initializer as an initializer.

  - Switched base and member initialization over to the new
    initialization code (InitializationSequence), so that it

  - Improved diagnostics for the new initialization code when
    initializing bases and members, to match the diagnostics produced
    by the previous (special-purpose) code.

  - Simplify the representation of type-checked constructor initializers in
    templates; instead of keeping the fully-type-checked AST, which is
    rather hard to undo at template instantiation time, throw away the
    type-checked AST and store the raw expressions in the AST. This
    simplifies instantiation, but loses a little but of information in
    the AST.

  - When type-checking implicit base or member initializers within a
    dependent context, don't add the generated initializers into the
    AST, because they'll look like they were explicit.

  - Record in CXXConstructExpr when the constructor call is to
  initialize a base class, so that CodeGen does not have to infer it
  from context. This ensures that we call the right kind of
  constructor.

There are also a few "opportunity" fixes here that were needed to not
regress, for example:

  - Diagnose default-initialization of a const-qualified class that
    does not have a user-declared default constructor. We had this
    diagnostic specifically for bases and members, but missed it for
    variables. That's fixed now.

  - When defining the implicit constructors, destructor, and
    copy-assignment operator, set the CurContext to that constructor
    when we're defining the body.

llvm-svn: 94952
2010-01-31 09:12:51 +00:00
..
AttributeList.cpp Parse C++ member check attributes - base_check, hiding, and override. 2009-11-25 04:20:27 +00:00
CMakeLists.txt Reorder files. 2009-07-21 21:03:50 +00:00
DeclSpec.cpp Improve source-location information for builtin TypeLocs, from Enea 2010-01-18 18:04:31 +00:00
Makefile -fno-rtti is now the default. 2010-01-24 20:43:31 +00:00
MinimalAction.cpp Keep track of the source locations for each protocol reference in 2010-01-16 15:02:53 +00:00
ParseCXXInlineMethods.cpp Refactor to remove more dependencies on PreDeclaratorDC. I seem to have made 2009-12-19 10:49:29 +00:00
ParseDecl.cpp Move the type specifier location for elaborated-type-specifiers from 2010-01-25 16:33:23 +00:00
ParseDeclCXX.cpp Rework base and member initialization in constructors, with several 2010-01-31 09:12:51 +00:00
ParseExpr.cpp Improve code completion by introducing patterns for the various C and 2010-01-10 23:08:15 +00:00
ParseExprCXX.cpp Reimplement constructor declarator parsing to cope with template-ids 2010-01-13 17:31:36 +00:00
ParseInit.cpp PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients 2009-10-18 21:17:35 +00:00
ParseObjc.cpp Keep track of the source locations for each protocol reference in 2010-01-16 15:02:53 +00:00
ParsePragma.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
ParsePragma.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
ParseStmt.cpp Use IdentifierInfo * instead of std::string for the AsmStmt names. 2010-01-30 22:25:16 +00:00
ParseTemplate.cpp Reimplement constructor declarator parsing to cope with template-ids 2010-01-13 17:31:36 +00:00
ParseTentative.cpp eliminate a call to NextToken() when parsing ::foo 2009-12-19 01:11:05 +00:00
Parser.cpp Fixit to remove 'volatile' in file-scope 'asm volatile'. 2010-01-25 23:12:50 +00:00
RAIIObjectsForParser.h Privatize class members. 2009-12-10 21:50:21 +00:00