[PATCH] D82563: [Sema][NFC] Remove Redundant Condition
This revision was automatically updated to reflect the committed changes. Closed by commit rG40c50bdee443: [Sema][NFC] Remove Redundant Condition (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82563/new/ https://reviews.llvm.org/D82563 Files: clang/lib/Sema/SemaType.cpp Index: clang/lib/Sema/SemaType.cpp === --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -1759,7 +1759,7 @@ // The effect of a cv-qualifier-seq in a function declarator is not the // same as adding cv-qualification on top of the function type. In the // latter case, the cv-qualifiers are ignored. -if (TypeQuals && Result->isFunctionType()) { +if (Result->isFunctionType()) { diagnoseAndRemoveTypeQualifiers( S, DS, TypeQuals, Result, DeclSpec::TQ_const | DeclSpec::TQ_volatile, S.getLangOpts().CPlusPlus Index: clang/lib/Sema/SemaType.cpp === --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -1759,7 +1759,7 @@ // The effect of a cv-qualifier-seq in a function declarator is not the // same as adding cv-qualification on top of the function type. In the // latter case, the cv-qualifiers are ignored. -if (TypeQuals && Result->isFunctionType()) { +if (Result->isFunctionType()) { diagnoseAndRemoveTypeQualifiers( S, DS, TypeQuals, Result, DeclSpec::TQ_const | DeclSpec::TQ_volatile, S.getLangOpts().CPlusPlus ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D82563: [Sema][NFC] Remove Redundant Condition
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Nice! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82563/new/ https://reviews.llvm.org/D82563 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D82563: [Sema][NFC] Remove Redundant Condition
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: sammccall, rsmith. baloghadamsoftware added a project: clang. Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs. Condition `TypeQuals` is checked both in an outer and in an inner `if` statement in static function `ConvertDeclSpecToType()` in file `SemaType.cpp`. This patch removes the redundant inner check. The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82563 Files: clang/lib/Sema/SemaType.cpp Index: clang/lib/Sema/SemaType.cpp === --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -1759,7 +1759,7 @@ // The effect of a cv-qualifier-seq in a function declarator is not the // same as adding cv-qualification on top of the function type. In the // latter case, the cv-qualifiers are ignored. -if (TypeQuals && Result->isFunctionType()) { +if (Result->isFunctionType()) { diagnoseAndRemoveTypeQualifiers( S, DS, TypeQuals, Result, DeclSpec::TQ_const | DeclSpec::TQ_volatile, S.getLangOpts().CPlusPlus Index: clang/lib/Sema/SemaType.cpp === --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -1759,7 +1759,7 @@ // The effect of a cv-qualifier-seq in a function declarator is not the // same as adding cv-qualification on top of the function type. In the // latter case, the cv-qualifiers are ignored. -if (TypeQuals && Result->isFunctionType()) { +if (Result->isFunctionType()) { diagnoseAndRemoveTypeQualifiers( S, DS, TypeQuals, Result, DeclSpec::TQ_const | DeclSpec::TQ_volatile, S.getLangOpts().CPlusPlus ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits