[cfe-commits] r65924 - in /cfe/trunk: include/clang/AST/DeclTemplate.h include/clang/Basic/DiagnosticSemaKinds.def lib/AST/DeclCXX.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaTemplate.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaType.cpp test/SemaTemplate/class-template-id-2.cpp test/SemaTemplate/class-template-spec.cpp test/SemaTemplate/instantiation-default-2.cpp
Chris Lattner
clattner at apple.com
Mon Mar 9 13:08:31 PDT 2009
On Mar 9, 2009, at 9:45 AM, Douglas Gregor wrote:
>>>
>>> + // If we have a class template specialization, try to instantiate
>>> + // it.
>>> + if (const RecordType *Record = T->getAsRecordType())
>>> + if (ClassTemplateSpecializationDecl *ClassTemplateSpec
>>> + = dyn_cast<ClassTemplateSpecializationDecl>(Record-
>>> >getDecl()))
>>
>> Can this be split out to a helper function in DeclTemplate? It
>> would be nice for SemaType.cpp to not #include DeclTemplate.h
>
>
> It could, but I don't see a way to make the split clean. The
> "instantiate this if it is a class template specialization"
> operation needs a three-state return type ("there's nothing to
> instantiate", "the instantiation failed", or "the instantiation
> succeeded"), and I found the resulting code uglier than the status
> quo.
>
Ok!
-Chris
More information about the cfe-commits
mailing list