[cfe-commits] [PATCH] Fix for CXXConstructExpr printing when implicit default argument is used.

Will Wilson will at indefiant.com
Wed Jan 30 16:46:25 PST 2013


Thanks for committing the last patch however there's another edge case not
covered by the previous patch:

  struct VirualDestrClass
  {
    VirualDestrClass(int arg);
    virtual ~VirualDestrClass();
  };

  struct ConstrWithCleanupsClass
  {
    ConstrWithCleanupsClass(const VirualDestrClass& cplx =
VirualDestrClass(42));
  };

  ConstrWithCleanupsClass cwcNoArg;

Here cwcNoArg has it's CXXConstructExpr wrapped in a ExprWithCleanups (to
handle the cleanup of the temporary). As the old code didn't look through
the implicit expressions the printed result was this:

  ConstrWithCleanupsClass cwcNoArg();

Patch attached with fix and new test-cases for review and commit if it
LGTY. All tests passed locally.

- Will.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130131/37a38655/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: default_arg_implicitexpr_fix.patch
Type: application/octet-stream
Size: 1715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130131/37a38655/attachment.obj>


More information about the cfe-commits mailing list