diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -3430,7 +3430,8 @@ // Note: We don't need to distribute declaration attributes (i.e. // D.getDeclarationAttributes()) because those are always C++11 attributes, // and those don't get distributed. - distributeTypeAttrsFromDeclarator(state, T); + if (!D.getAttributes().empty()) + distributeTypeAttrsFromDeclarator(state, T); // Find the deduced type in this type. Look in the trailing return type if we // have one, otherwise in the DeclSpec type.