std :: launder与reinterpret_cast一起使用

use*_*999 10 c++ language-lawyer reinterpret-cast

今天在回答" 基于堆的分配数组的循环范围 "的问题时,我偶然发现了使用reinterpret_cast从指针类型转换为数组类型的建议std::launder(经过一些讨论我们决定发布一个新问题,因为我们不能找到结论.)演员如下完成(例如,为了能够使用基于范围的循环迭代数组):

int* ptr = new int[3];
auto arr_ptr = std::launder(reinterpret_cast<int (*)[3]>(ptr));
Run Code Online (Sandbox Code Playgroud)

我几乎可以肯定这是UB,但我不太确定.有没有人在C++中足够坚定地回答这个问题?

我认为这可以解释为什么reinterpret_cast在从ptr-type转换为array-type(我认为是UB)时是否有效,并且无论我是否使用它都没有std::launder.