llvm-project
llvm-project copied to clipboard
constant not unnamed_addr?
| Bugzilla Link | 10416 |
| Resolution | INVALID |
| Resolved on | Jul 25, 2011 06:56 |
| Version | trunk |
| OS | All |
| CC | @efriedma-quic |
Extended Description
From 2006-03-03-MissingInitializer.c it looks like foo.nate should be able to be unnamed_addr and llvm-gcc does that
struct X { int *XX; int Y;};
void foo() { static int nate = 0; struct X bob = { &nate, 14 }; bar(&bob); }
I can agree with that.
IMO, clang is correct here... "nate" has a distinct address per the standard, and us defaulting to -fmerge-all-constants shouldn't have any effect on something that isn't a constant.