[PATCH] D92577: Don't reject tag declarations in for loop clause-1

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 17 10:38:05 PST 2020


rjmccall added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:1846
+            (*Iter)->setInvalidDecl();
+          }
         }
----------------
You can have multiple tag declarations because of complex declarators or type-specifiers, e.g. `struct A (*var)(struct B)` or `_Atomic(struct A(*)(struct B))`.  It should already be an error to write the latter without a declarator, but you do need to not diagnose if there *is* a declarator.  Probably the right way to write this is to ignore tags in the first walk but remember whether you saw a non-tag; if you don't, diagnose the first tag.


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

https://reviews.llvm.org/D92577



More information about the cfe-commits mailing list