[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D125259#3522198 , @aaron.ballman wrote: > In D125259#3520118 , @aaron.ballman > wrote: > >> In D125259#3519947 , >> @aaron.ballman wro

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D125259#3520118 , @aaron.ballman wrote: > In D125259#3519947 , @aaron.ballman > wrote: > >> Oh wow, good catch! I'll correct this. > > Oof, the plot thickens... the diagnostic i

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D125259#3520544 , @tahonermann wrote: >> I'm questioning the benefit to supporting _Generic in C++ and starting to >> wonder if perhaps we should pull this extension back. > > I imagine it may be used in shared system h

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-17 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann added a comment. > I'm questioning the benefit to supporting _Generic in C++ and starting to > wonder if perhaps we should pull this extension back. I imagine it may be used in shared system headers. E.g., implementations of `tgmath.h` that don't use the builtins. Repository: rG

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a subscriber: rsmith. aaron.ballman added a comment. In D125259#3519947 , @aaron.ballman wrote: > Oh wow, good catch! I'll correct this. Oof, the plot thickens... the diagnostic is correct for some types, but is incorrect for others

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D125259#3519822 , @aeubanks wrote: > $ cat /tmp/a.cc > typedef struct Test { > } Test; > > void f() { > const Test constVal; > _Generic(constVal, const Test : 0); > } > $ ./build/rel/bin/clang -fsyn

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-17 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added a comment. $ cat /tmp/a.cc typedef struct Test { } Test; void f() { const Test constVal; _Generic(constVal, const Test : 0); } $ ./build/rel/bin/clang -fsyntax-only -x c++ /tmp/a.cc -Wall /tmp/a.cc:6:28: warning: due to lvalue conversion of the controlling

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-10 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:1702 + + if (Reason) +Diag(Types[i]->getTypeLoc().getBeginLoc(), aaron.ballman wrote: > erichkeane wrote: > > Splitting this up into the separate line for only 2 items

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:1702 + + if (Reason) +Diag(Types[i]->getTypeLoc().getBeginLoc(), erichkeane wrote: > Splitting this up into the separate line for only 2 items seems like a waste, >

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-10 Thread Aaron Ballman 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 rGca75ac5f04f2: Diagnose unreachable generic selection associations (authored by aaron.ballman). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-09 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann accepted this revision. tahonermann added a comment. Looks good to me! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125259/new/ https://reviews.llvm.org/D125259 ___ cfe-commits mailing list

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-09 Thread Erich Keane via Phabricator via cfe-commits
erichkeane accepted this revision. erichkeane added a comment. This revision is now accepted and ready to land. One minor preference, otherwise LGTM. Comment at: clang/lib/Sema/SemaExpr.cpp:1702 + + if (Reason) +Diag(Types[i]->getTypeLoc().getBeginLoc(), --

[PATCH] D125259: [C11] Diagnose unreachable generic selection associations

2022-05-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: tahonermann, jyknight, eli.friedman, clang-language-wg. Herald added a project: All. aaron.ballman requested review of this revision. Herald added a project: clang. The controlling expression of a `_Generic` selection expression