On 12/15/2012 04:24 PM, Rafael Espíndola wrote:
static int y;
void foo(void) {
extern int y;
}
the second declaration of `y' is now getting external linkage, while it
should be internal linkage (tested on r170126).
BTW, how are you testing this? I tried
template<int &x>
void zed() {
}
static int y;
void foo(void) {
extern int y;
zed<y>();
}
But I get an internal _Z3zedILZL1yEEvv.
We got a regression in one of our tests for the C code I reported above.
We have lots of AST visitors (checking for compliance wrt many different
coding standards guidelines): one of those was calling method
NamedDecl::getLinkage()
and getting a result different wrt the expected one.
As for your C++ testcase ... I can not tell without studying clang
source code. As a wild guess, could it be the case that clang has
significantly different code for the C++ case?
Enea.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits