[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-24 Thread Yuanfang Chen via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG217f0f735afe: [Clang][Sema] Implement GCC -Wcast-function-type (authored by ychen). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-24 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen updated this revision to Diff 333162. ychen added a comment. - update doc to match diagnostics Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97831/new/ https://reviews.llvm.org/D97831 Files: clang/docs/DiagnosticsReference.rst

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-24 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added a comment. Thanks for the insightful suggestions. I'll definitely send a follow-up patch for these (pointerLike arguments, TargetInfo refactoring, promotable integral types). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97831/new/

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Looks good. Some possible improvements to make the diagnostic a bit more precise, but I'd be happy if you want to address some of those as follow-ups after this change.

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-23 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added inline comments. Comment at: clang/lib/Sema/SemaCast.cpp:1044-1048 + // Allow integral type mismatch if their size are equal. + if (SrcType->isIntegralType(Context) && DestType->isIntegralType(Context)) +if (Context.getTypeInfoInChars(SrcType).Width == +

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-23 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen updated this revision to Diff 332840. ychen marked 3 inline comments as done. ychen added a comment. - Add code/tests for `function -> function pointer` and `block pointer -> function pointer`. - Use Context.hasSameUnqualifiedType - Style Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-23 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8368 +def warn_cast_function_type : Warning< + "cast between incompatible function types from %0 to %1">, + InGroup, DefaultIgnore; I'd find something like "cast from

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-23 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97831/new/ https://reviews.llvm.org/D97831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-22 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen updated this revision to Diff 332384. ychen added a comment. - update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97831/new/ https://reviews.llvm.org/D97831 Files: clang/docs/DiagnosticsReference.rst

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-16 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added a comment. ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97831/new/ https://reviews.llvm.org/D97831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-08 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added a comment. ping? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97831/new/ https://reviews.llvm.org/D97831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D97831: [Clang][Sema] Implement GCC -Wcast-function-type

2021-03-02 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen created this revision. ychen added reviewers: aaron.ballman, rsmith. ychen requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Warn when a function pointer is cast to an incompatible function pointer. In a cast involving function