## test case
```
void main() {
pragma(mangle, "puts")
extern(C) static int puts(const char*);
puts("test");
}
```
## output
/tmp/temp_7FF8B2F14490.d:2:5: Error: unrecognized `pragma(mangle)`
/tmp/temp_7FF8B2F14490.d:4:5: Error: undefined identifier `puts`
Comment #1 by b2.temp — 2023-09-06T19:32:13Z
A better test case, as in the first the final intention is a bit more complex.
```d
void main()
{
pragma(mangle, "main.v")
void v(){}
}
```
Comment #2 by dlang-bot — 2023-09-06T20:47:00Z
@SixthDot created dlang/dmd pull request #15582 "fix issue 22682 - `pragma(mangle)` does not work for nested functions" fixing this issue:
- fix issue 22682 - `pragma(mangle)` does not work for nested functions
This is usefull to wrap C functions headers directly in a D wrapper
https://github.com/dlang/dmd/pull/15582
Comment #3 by b2.temp — 2023-09-07T00:29:25Z
*** Issue 17638 has been marked as a duplicate of this issue. ***
Comment #4 by dlang-bot — 2023-09-08T10:14:27Z
dlang/dmd pull request #15582 "fix issue 22682 - `pragma(mangle)` does not work for nested functions" was merged into master:
- 440bf2139eff9cc1ee4e22734734e69db3dec0f7 by Basile Burg:
fix issue 22682 - `pragma(mangle)` does not work for nested functions
This is usefull to declare C functions headers directly in a D wrapper
https://github.com/dlang/dmd/pull/15582