================
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



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to