[clang] 1795fa5 - [NFC] Update example in comment

via cfe-commits cfe-commits at lists.llvm.org
Thu May 16 03:09:41 PDT 2024


Author: Sirraide
Date: 2024-05-16T12:08:39+02:00
New Revision: 1795fa58bac5092f758bf27e1b27a2b333307bab

URL: https://github.com/llvm/llvm-project/commit/1795fa58bac5092f758bf27e1b27a2b333307bab
DIFF: https://github.com/llvm/llvm-project/commit/1795fa58bac5092f758bf27e1b27a2b333307bab.diff

LOG: [NFC] Update example in comment

Added: 
    

Modified: 
    clang/lib/Sema/SemaExpr.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index cc507524e2fc2..151cda5d68b01 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -7133,10 +7133,10 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo,
       //
       // But: C99-C23 6.5.2.5 Compound literals constraint 1: The type name
       // shall specify an object type or an array of unknown size, but not a
-      // variable length array type. This seems odd, as it allows int a[size] =
-      // {}; but forbids int a[size] = (int[size]){}; As this is what the
-      // standard says, this is what's implemented here for C (except for the
-      // extension that permits constant foldable size arrays)
+      // variable length array type. This seems odd, as it allows 'int a[size] =
+      // {}', but forbids 'int *a = (int[size]){}'. As this is what the standard
+      // says, this is what's implemented here for C (except for the extension
+      // that permits constant foldable size arrays)
 
       auto diagID = LangOpts.CPlusPlus
                         ? diag::err_variable_object_no_init


        


More information about the cfe-commits mailing list