[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: rsmith, comex, erichkeane, jyknight, rjmccall. Herald added a project: All. aaron.ballman requested review of this revision. Herald added a project: clang. Currently, Clang handles some qualifiers correctly for `__auto_type`, but

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-18 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Just a couple of questions/concerns! Otherwise it LGTM. Since I have a suggestion for a code change, I'll hold off on approval until you do it or give a reasonable reason why not. Comment at: clang/lib/AST/ASTContext.cpp:10290 +// information.

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 416911. aaron.ballman added a comment. Updated based on review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122029/new/ https://reviews.llvm.org/D122029 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/Type.h clang/

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:10290 +// information. +if (const auto *AT = LHS->getAs()) { + if (AT->getKeyword() == AutoTypeKeyword::GNUAutoType) erichkeane wrote: > So do we care if BOTH sides are thi

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:1929 + const auto *AT = dyn_cast(T); + if (!AT || AT->isGNUAutoType()) { +DiagID = diag::err_typecheck_invalid_restrict_not_pointer; The RHS here should NEVER be true. I

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-21 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:10294 +} +if (const auto *AT = LHS->getAs()) { + if (AT->isGNUAutoType()) Same? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122029/new/ https://reviews.llvm.org/D12

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:10294 +} +if (const auto *AT = LHS->getAs()) { + if (AT->isGNUAutoType()) xbolva00 wrote: > Same? Oooh, good catch! Looks like it should be RHS->getAs CHANGES SINCE LAST AC

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 416928. aaron.ballman marked 2 inline comments as done. aaron.ballman added a comment. Updated based on review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122029/new/ https://reviews.llvm.org/D122029 Files: clang/docs/ReleaseNot

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:10294 +} +if (const auto *AT = LHS->getAs()) { + if (AT->isGNUAutoType()) erichkeane wrote: > xbolva00 wrote: > > Same? > Oooh, good catch! Looks like it should be RHS->ge

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. FWIW, I plan to land this sometime tomorrow (Mar 23) unless there are additional review comments before then. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122029/new/ https://reviews.llvm.org/D122029 ___ cfe-c

[PATCH] D122029: Change __auto_type behavior with qualifiers to match GCC behavior

2022-03-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. Thanks for the reviews, I've committed in e4a42c5b64d044ae28d9483b0ebd12038d5b5917 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122029/new/ https: