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 {
534
534
consteval void fn () {}
535
535
536
536
template <typename >
537
- constexpr int tfn (int ) {
537
+ constexpr auto tfn (int ) {
538
538
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;
540
540
}
541
541
542
- int g () {
542
+ void g () {
543
543
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}}
546
546
}
547
547
548
548
}
You can’t perform that action at this time.
0 commit comments