[clang] [C] Add diagnostic + attr for unterminated strings (PR #137829)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 29 08:56:34 PDT 2025
================
@@ -4907,6 +4907,20 @@ void Sema::AddModeAttr(Decl *D, const AttributeCommonInfo &CI,
D->addAttr(::new (Context) ModeAttr(Context, CI, Name));
}
+static void handleNonStringAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+ // This only applies to fields and variable declarations which have an array
+ // type.
+ QualType QT = cast<ValueDecl>(D)->getType();
+ if (!QT->isArrayType() ||
+ !QT->getBaseElementTypeUnsafe()->isAnyCharacterType()) {
----------------
erichkeane wrote:
Should this be ill-formed on VLAs?
https://github.com/llvm/llvm-project/pull/137829
More information about the cfe-commits
mailing list