[cfe-commits] [PATCH] Refactor/fix some issues with templates and member initializers

Fariborz Jahanian fjahanian at apple.com
Mon Jul 27 09:26:34 PDT 2009


Refactoring looks good, thanks. Dependent type checking part looks ok  
too. But I let Doug be judge
of that.

One minor refactoring suggestion:

+  bool HasDependentArg = false;
+  for (unsigned i = 0; i < NumArgs; i++)
+    HasDependentArg |= Args[i]->isTypeDependent();

Don't need to continue the iteration once  HasDependentArg is set to  
true.

- Fariborz

On Jul 25, 2009, at 6:13 PM, Eli Friedman wrote:

> Patch attached.  Fixes all the testcases in PR4621.
>
> This change refactors ActOnMemInitializer so the relevant code can be
> called from template instantiation (although I haven't added the
> appropriate code).  It adds appropriate checks for arguments with
> dependent types.  It also fixes some broken logic for member
> initializers which would reject initializing a member with a dependent
> type.
>
> I've attached both a regular diff and a diff -w because the latter is
> a bit easier to read; I ended up reindenting a lot of the code.
>
> (I decided to submit the patch instead of just committing it because
> I'm not sure this is the right approach.)
>
> -Eli
> <diff.txt><diffw.txt>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list