https://github.com/PiotrZSL commented:
It's not so easy, as for example you not detecting if after construction such object is being modified or even moved. Basically you would need to ensure that only const methods are called on such object and it's never moved, or re-assign later. Additionally some objects may have side-effects (like high memory usage) or may not be thread safe, therefor every thread would need own copy via thread_local. Default configuration should actually include all classes from "STL" that meet conditions. And class may not have constructor but may be initialized via init list. Additionally if some static casts will be used in constructor arguments, it won't work and it won't work for example for std::map with constexpr arguments. You need more generic aproach that would check if construction uses any "non allowed" expresions, in such case it would work on any class. Or limit check only to regexp. https://github.com/llvm/llvm-project/pull/131455 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits