File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -534,15 +534,15 @@ namespace GH123405 {
534534consteval void fn () {}
535535
536536template <typename >
537- constexpr int tfn (int ) {
537+ constexpr auto tfn (int ) {
538538 auto p = &fn; // expected-note {{'tfn<int>' is an immediate function because its body evaluates the address of a consteval function 'fn'}}
539- return int (p); // expected-error {{cast from pointer to smaller type 'int' loses information}}
539+ return p;
540540}
541541
542- int g () {
542+ void g () {
543543 int a; // expected-note {{declared here}}
544- return tfn<int >(a); // expected-error {{call to immediate function 'GH123405::tfn<int>' is not a constant expression}}\
545- // expected-note {{read of non-const variable 'a' is not allowed in a constant expression}}
544+ tfn<int >(a); // expected-error {{call to immediate function 'GH123405::tfn<int>' is not a constant expression}}\
545+ // expected-note {{read of non-const variable 'a' is not allowed in a constant expression}}
546546}
547547
548548}
You can’t perform that action at this time.
0 commit comments