mboehme created this revision. Herald added a project: All. mboehme requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
This check was present before https://reviews.llvm.org/D126061. I eliminated it as part of that patch because it seemed superfluous; the check has no influence on behavior. However, as @yurai007 points out in https://reviews.llvm.org/D128097, this change may have had a negative impact on compile time, so I'm adding the check back in. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D128439 Files: clang/lib/Sema/SemaType.cpp Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ 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.
Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ 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.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits