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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 18:56:10 PDT 2019


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: clang/lib/Sema/SemaInit.cpp:2046
+          SemaRef.getLangOpts().CPlusPlus2a) {
+        SemaRef.Diag(Init->getBeginLoc(), diag::ext_designated_init)
+            << Init->getSourceRange();
----------------
This should use a distinct diagnostic that says what part is an extension.


================
Comment at: clang/lib/Sema/SemaInit.cpp:3096
+        HasArrayDesignator) {
+      Diag(DIE->getBeginLoc(), diag::ext_designated_init)
+          << DIE->getSourceRange();
----------------
Likewise here, we should say what specifically is an extension.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59754/new/

https://reviews.llvm.org/D59754





More information about the cfe-commits mailing list