Doug, As per your instructions to me in the cfe-dev group, I am posting this patch to the cfe-commits group.
All, This patch is supposed to address the following bug: http://llvm.org/bugs/show_bug.cgi?id=6904#c2 Essentially clang allows the following redefinition, and it shouldn't : struct S { static const int i = 0; }; const int S::i = 5; The patch is quite simple and basically checks each variable declaration if it has previously been initialized (this is a separate check from a definition check only in the case of the in-class static int initializer i believe), before it adds an initializer. Because there are two separate functions that do DirectInitialization and CopyInitialization, I added the exact same code to both of them. I would appreciate any feedback. Thanks! Faisal Vali
int-static-var-redef-bug-2.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
