https://github.com/PiotrZSL requested changes to this pull request.

It's not so easy, because if result of &[] is used as non-const, then using 
c_str will make code non-compilable. Some additional checks wuold be required, 
like checking if object is const, or checking if there is implicit cast to 
const pointer from an nonconst pointer, only then c_str could be used.

Make "f" function take non-const pointer, then you will see.
Also there can be an issue when for example, container have only-const version 
of some functions (c_str).

https://github.com/llvm/llvm-project/pull/71304
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to