[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-06-14 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D59754#1543949 , @sokolovd wrote: > This looks like exactly what we need for my project. We're using Clang and > Designated Initializers but would like to make sure that we use those in > C++20 compatible manner. Is this

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-06-14 Thread Dmitry Sokolov via Phabricator via cfe-commits
sokolovd added a comment. This looks like exactly what we need for my project. We're using Clang and Designated Initializers but would like to make sure that we use those in C++20 compatible manner. Is this blocked on something? Any way I can help? Repository: rG LLVM Github Monorepo

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-04-22 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2069-2072 +if (!VerifyOnly && HasDesignatedInit && SemaRef.getLangOpts().CPlusPlus2a) { + SemaRef.Diag(Init->getBeginLoc(), diag::ext_c20_designated_init)

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-04-21 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2069-2072 +if (!VerifyOnly && HasDesignatedInit && SemaRef.getLangOpts().CPlusPlus2a) { + SemaRef.Diag(Init->getBeginLoc(), diag::ext_c20_designated_init)

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-04-17 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. I think you're missing the enforcement of the rule that the same field name cannot be designated multiple times in a single //designated-initializer-list//. I'm fine with that being done separately (not as part of this patch), though. Comment at:

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-04-17 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 195611. hintonda added a comment. - Fix typo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.org/D59754 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-04-17 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 195610. hintonda added a comment. - Removed auto and added specific warnings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.org/D59754 Files:

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-04-15 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2017 + auto LastIdx = Field != FieldEnd + ? Field->getFieldIndex() Please use an actual type rather than `auto` here and below. Comment at:

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-04-10 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. ping, and should we add new warning messages as suggested by @Rakete ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.org/D59754 ___

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2044 + : std::distance(RD->field_begin(), RD->field_end()); + if (VerifyOnly && (LastIdx >= NextIdx || HasNonDesignatedInit) && + SemaRef.getLangOpts().CPlusPlus2a)

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192233. hintonda added a comment. - Missed one set of braces. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.org/D59754 Files: clang/lib/Sema/SemaInit.cpp

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192232. hintonda added a comment. - Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.org/D59754 Files: clang/lib/Sema/SemaInit.cpp

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2044 + : std::distance(RD->field_begin(), RD->field_end()); + if (VerifyOnly && (LastIdx >= NextIdx || HasNonDesignatedInit) && +

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:30 +// out of order designators +A a1 = {.y = 1, .x = 2}; // expected-warning {{designated initializers are a C99 feature}} +

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:30 +// out of order designators +A a1 = {.y = 1, .x = 2}; // expected-warning {{designated initializers are a C99 feature}} + hintonda wrote: > lebedev.ri wrote: >

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:30 +// out of order designators +A a1 = {.y = 1, .x = 2}; // expected-warning {{designated initializers are a C99 feature}} +

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:30 +// out of order designators +A a1 = {.y = 1, .x = 2}; // expected-warning {{designated initializers are a C99 feature}} + hintonda wrote: > Rakete wrote: >

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked 2 inline comments as done. hintonda added a comment. Thanks for the review. Comment at: clang/lib/Sema/SemaInit.cpp:2017 + auto LastIdx = Field != FieldEnd + ? Field->getFieldIndex() Rakete wrote: > Can

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2017 + auto LastIdx = Field != FieldEnd + ? Field->getFieldIndex() Can `Field` ever be `FieldEnd` at this point? Comment at:

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-24 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192049. hintonda added a comment. - Fix variable typo/spellings, and add missing flag assignment and additional test to catch it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-24 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2002 bool HasDesignatedInit = false; + bool HasNonDesginatedInit = false; typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/