[PATCH] Bugfix in template instantiation.
Alexey Bataev
a.bataev at hotmail.com
Tue Oct 14 03:11:14 PDT 2014
David, thanks. I'll fix this.
Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team
14.10.2014 12:59, David Majnemer пишет:
> ================
> Comment at: lib/Sema/SemaCXXScopeSpec.cpp:144
> @@ -143,4 +143,3 @@
> case NestedNameSpecifier::TypeSpecWithTemplate: {
> - const TagType *Tag = NNS->getAsType()->getAs<TagType>();
> - assert(Tag && "Non-tag type in nested-name-specifier");
> - return Tag->getDecl();
> + if (const TagType *Tag = NNS->getAsType()->getAs<TagType>())
> + return Tag->getDecl();
> ----------------
> No need to repeat TagType, we know what it is from the right hand side. I'd recommend:
> if (const auto *Tag = NNS->getAsType()->getAs<TagType>())
>
> ================
> Comment at: lib/Sema/SemaExprMember.cpp:599
> @@ -598,2 +598,3 @@
> // nested-name-specifier.
> - DC = SemaRef.computeDeclContext(SS, false);
> + if ((DC = SemaRef.computeDeclContext(SS, false)) == nullptr) {
> + SemaRef.Diag(SS.getBeginLoc(), diag::err_expected_class_or_namespace)
> ----------------
> This is unusual in clang's codebase, I'd recommend:
> DC = SemaRef.computeDeclContext(SS, /*EnteringContext=*/false);
> if (!DC) {
>
> http://reviews.llvm.org/D5769
>
>
http://reviews.llvm.org/D5769
More information about the cfe-commits
mailing list