================ @@ -528,3 +528,21 @@ D d(0); // expected-note {{in implicit initialization for inherited constructor // expected-error@-1 {{call to immediate function 'GH112677::D::SimpleCtor' is not a constant expression}} } + +namespace GH123405 { + +consteval void fn() {} + +template <typename> +constexpr int tfn(int) { + auto p = &fn; // expected-note {{'tfn<int>' is an immediate function because its body evaluates the address of a consteval function 'fn'}} + return int(p); // expected-error {{cast from pointer to smaller type 'int' loses information}} ---------------- cor3ntin wrote:
i completely removed the conversion to it, it was not salient to the test. this is just testing that tfn becomes immediate https://github.com/llvm/llvm-project/pull/124404 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits