]> granicus.if.org Git - clang/commitdiff
Speculative fix for buildbot failures after r338464.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 1 Aug 2018 01:57:49 +0000 (01:57 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 1 Aug 2018 01:57:49 +0000 (01:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338473 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 50ea98e7f60db2477e2ee2ac9ddc1754a4b4c516..eb76b949af8960cc1d37f62b4eda45d96c80e7c0 100644 (file)
@@ -6012,7 +6012,8 @@ static void checkAttributesAfterMerging(Sema &S, NamedDecl &ND) {
   // Check the attributes on the function type, if any.
   if (const auto *FD = dyn_cast<FunctionDecl>(&ND)) {
     for (TypeLoc TL = FD->getTypeSourceInfo()->getTypeLoc();
-         auto ATL = TL.getAsAdjusted<AttributedTypeLoc>();
+         auto ATL = TL ? TL.getAsAdjusted<AttributedTypeLoc>()
+                       : AttributedTypeLoc();
          TL = ATL.getModifiedLoc()) {
       // The [[lifetimebound]] attribute can be applied to the implicit object
       // parameter of a non-static member function (other than a ctor or dtor)