[clang] [docs] Add a more detailed description in CXString.h. (PR #119090)
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 9 08:21:19 PST 2024
================
@@ -46,6 +46,9 @@ typedef struct {
/**
* Retrieve the character data associated with the given string.
+ *
+ * The caller shouldn't free the returned string data, and the returned string
+ * data shouldn't be accessed after the \c CXString disposed.
----------------
compnerd wrote:
I'm not sure I have a better way to phrase it off hand. The validity here is referring to lifetimes in C/C++, which is normally described as "valid". See https://en.cppreference.com/w/cpp/string/basic_string/c_str as an example of the opposite (i.e. invalidation vs valid).
https://github.com/llvm/llvm-project/pull/119090
More information about the cfe-commits
mailing list