[cfe-commits] r72233 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/Expr.cpp lib/Sema/SemaInit.cpp lib/Sema/SemaTemplateInstantiateExpr.cpp test/SemaTemplate/fun-template-def.cpp test/SemaTemplate/instantiate-c99.cpp

Douglas Gregor dgregor at apple.com
Thu May 21 17:40:07 PDT 2009


On May 21, 2009, at 5:36 PM, Eli Friedman wrote:

> On Thu, May 21, 2009 at 4:17 PM, Douglas Gregor<dgregor at apple.com>  
> wrote:
>> Also, delay semantic analysis of initialization for
>> value-dependent as well as type-dependent expressions, since we can't
>> always properly type-check a value-dependent expression.
>
> It seems like we should be able to handle most cases without delay;
> there's only one case I can think of where we can't resolve it
> immediately.  That said, the edge case in question is rather nasty:
> template<int N> struct X { void f() { int* X = N; } };
> template struct X<0>;
> template struct X<1>;


That's exactly the edge case that I was thinking of :)

Perhaps we can just deal with that edge case in isolation. The trick,  
of course, is to not go ahead and make a decision about, e.g.,  
overload resolution based on that case.

	- Doug



More information about the cfe-commits mailing list