[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-18 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 264697. pestctrl edited the summary of this revision. pestctrl added a comment. Rebased on top of master Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-14 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 264089. pestctrl added a comment. Updated test to also expect a warning along with the newly added error. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-14 Thread Benson Chu via Phabricator via cfe-commits
pestctrl created this revision. pestctrl added a reviewer: rsmith. pestctrl added a project: clang. Clang is missing one of the conditions for C99 6.5.9p2, where comparison between pointers must either both point to incomplete types or both point to complete types. This patch adds an extra

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-20 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added a comment. @efriedma I think you were the last person to touch this code regarding cases where pointer comparisons are invalid. Could you have a look at my changes and gimme some feedback? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-26 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 266214. pestctrl added a comment. Forgot to add a comma >_< Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-27 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 266645. pestctrl marked an inline comment as done. pestctrl added a comment. ext_typecheck_compare_complete_incomplete_pointers: - Moved to group C11. ext_typecheck_compare_complete_incomplete_pointers: - Changed to Warning from ExtWarn - Moved to group

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-27 Thread Benson Chu via Phabricator via cfe-commits
pestctrl marked an inline comment as done. pestctrl added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6447 + InGroup; +def warn_typecheck_compare_complete_incomplete_pointers : ExtWarn< + "ordered comparison of complete and incomplete pointers

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-25 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 265907. pestctrl added a comment. Both extension and extwarn need to be in the c99-extensions group Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-25 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 265908. pestctrl added a comment. Rebase on master. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-25 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 266086. pestctrl added a comment. Rebase on master? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-25 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 265898. pestctrl added a comment. Added warning to group c99-extensions, only enable warning when C99 or less Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-28 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 266880. pestctrl added a comment. clang-format for the test file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-22 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added a comment. Hey @efriedma, thanks again for the comments. Yes, you were correct in that this message should only be emitted for relational comparisons. Regarding having the warning off by default, I did want to point out that GCC enables this warning by default:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-22 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 265807. pestctrl added a comment. Changed error to warning, only emit during a relational operation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-05-21 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added a comment. Ah, you're right. I don't see the clause in the C11 standard. I'll see what I can do. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-02 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 267901. pestctrl added a comment. Updated test with new error message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-02 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 267876. pestctrl added a comment. Updated warning message to be more descriptive Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-02 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 267950. pestctrl added a comment. Copy pasted error messages Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-02 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 267947. pestctrl added a comment. Copy pasted error message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-02 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 267920. pestctrl added a comment. Tests need to contain the full error message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-17 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added a comment. Benson Chu Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-16 Thread Benson Chu via Phabricator via cfe-commits
pestctrl marked 5 inline comments as done. pestctrl added a comment. @rsmith @efriedma Any more comments? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 ___

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-10 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 269824. pestctrl added a comment. Don't diagnose outside of C99 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-10 Thread Benson Chu via Phabricator via cfe-commits
pestctrl marked 2 inline comments as done. pestctrl added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11571 + Diag(Loc, + getLangOpts().C11 + ? diag::ext_typecheck_compare_complete_incomplete_pointers

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-10 Thread Benson Chu via Phabricator via cfe-commits
pestctrl marked 2 inline comments as done. pestctrl added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6451 + "%1 is %select{|in}3complete">, + InGroup; def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-08 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added a comment. @efriedma Any more comments? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-09 Thread Benson Chu via Phabricator via cfe-commits
pestctrl marked an inline comment as done. pestctrl added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11571 + Diag(Loc, + getLangOpts().C11 + ? diag::ext_typecheck_compare_complete_incomplete_pointers

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-11 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 270139. pestctrl added a comment. Moved the extension to C11 group Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79945/new/ https://reviews.llvm.org/D79945 Files:

[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

2020-06-11 Thread Benson Chu via Phabricator via cfe-commits
pestctrl marked an inline comment as done. pestctrl added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6451 + "%1 is %select{|in}3complete">, + InGroup; def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn<

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-07-03 Thread Benson Chu via Phabricator via cfe-commits
pestctrl marked an inline comment as done. pestctrl added a comment. @rsmith Ping! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99732/new/ https://reviews.llvm.org/D99732 ___ cfe-commits mailing list

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-04-01 Thread Benson Chu via Phabricator via cfe-commits
pestctrl created this revision. pestctrl added reviewers: akyrtzi, rsmith. pestctrl added a project: clang. pestctrl requested review of this revision. Herald added a subscriber: cfe-commits. I noticed this bug because attributes were being dropped from tentative definitions after the second

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-04-03 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 335113. pestctrl edited the summary of this revision. pestctrl added a comment. Removed extra pass over decl chain for acting definition. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99732/new/

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-04-03 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added inline comments. Comment at: clang/lib/AST/Decl.cpp:2192 DefinitionKind Kind = isThisDeclarationADefinition(); - if (Kind != TentativeDefinition) + if (Kind != TentativeDefinition || hasDefinition()) return nullptr; rsmith wrote: > Is

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-04-12 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added a comment. Ping! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99732/new/ https://reviews.llvm.org/D99732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-08-15 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 366522. pestctrl added a comment. Only look for attributes in check string for unit test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99732/new/ https://reviews.llvm.org/D99732 Files:

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-08-15 Thread Benson Chu via Phabricator via cfe-commits
pestctrl updated this revision to Diff 366513. pestctrl added a comment. Update comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99732/new/ https://reviews.llvm.org/D99732 Files: clang/lib/AST/Decl.cpp

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-08-24 Thread Benson Chu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9a5f38885056: [AST] Pick last tentative definition as the acting definition (authored by pestctrl). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99732/new/

[PATCH] D99732: [AST] Pick last tentative definition as the acting definition

2021-08-16 Thread Benson Chu via Phabricator via cfe-commits
pestctrl added a comment. @mizvekov Thanks for the help! I recently got commit access, so I think I can commit this myself. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99732/new/ https://reviews.llvm.org/D99732