[cfe-commits] r65388 - /cfe/trunk/include/clang/AST/Expr.h

Chris Lattner sabre at nondot.org
Tue Feb 24 13:52:16 PST 2009


Author: lattner
Date: Tue Feb 24 15:52:14 2009
New Revision: 65388

URL: http://llvm.org/viewvc/llvm-project?rev=65388&view=rev
Log:
improve comments.

Modified:
    cfe/trunk/include/clang/AST/Expr.h

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=65388&r1=65387&r2=65388&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Tue Feb 24 15:52:14 2009
@@ -479,11 +479,18 @@
 /// or L"bar" (wide strings).  The actual string is returned by getStrData()
 /// is NOT null-terminated, and the length of the string is determined by
 /// calling getByteLength().  The C type for a string is always a
-/// ConstantArrayType.
+/// ConstantArrayType.  In C++, the char type is const qualified, in C it is
+/// not.
 ///
 /// Note that strings in C can be formed by concatenation of multiple string
 /// literal pptokens in translation phase #6.  This keeps track of the locations
 /// of each of these pieces.
+///
+/// Strings in C can also be truncated and extended by assigning into arrays,
+/// e.g. with constructs like:
+///   char X[2] = "foobar";
+/// In this case, getByteLength() will return 6, but the string literal will
+/// have type "char[2]".
 class StringLiteral : public Expr {
   const char *StrData;
   unsigned ByteLength;





More information about the cfe-commits mailing list