https://bugs.llvm.org/show_bug.cgi?id=51483
Bug ID: 51483
Summary: Error if immediate function is used as default
function argument initializer
Product: clang
Version: 12.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Compilation of this valid code:
```
consteval int foo() { return 0; }
int bar(int a = foo()) { return a; }
int main() { return bar(); }
```
results in error:
```
error: cannot take address of consteval function 'foo' outside of an immediate
invocation
int bar(int a = foo()) { return a; }
^
```
Other compilers accept: https://gcc.godbolt.org/z/z8h7MPaGx
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs