[clang] Reland #90786 ([BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C) (PR #93121)

Henrik G. Olsson via cfe-commits cfe-commits at lists.llvm.org
Thu May 23 11:59:43 PDT 2024


================
@@ -4944,6 +4944,26 @@ void Parser::ParseStructDeclaration(
   }
 }
 
+// TODO: All callers of this function should be moved to
+// `Parser::ParseLexedAttributeList`.
+void Parser::ParseLexedCAttributeList(LateParsedAttrList &LAs, bool EnterScope,
+                                      ParsedAttributes *OutAttrs) {
+  assert(LAs.parseSoon() &&
+         "Attribute list should be marked for immediate parsing.");
+#ifndef NDEBUG
+  auto LangStd = getLangOpts().LangStd;
+  if (LangStd != LangStandard::lang_unspecified) {
+    auto Lang = LangStandard::getLangStandardForKind(LangStd).getLanguage();
+    assert(Lang == Language::C || Lang == Language::OpenCL);
----------------
hnrklssn wrote:

Do we have any tests triggering the OpenCL path?

https://github.com/llvm/llvm-project/pull/93121


More information about the cfe-commits mailing list