[PATCH] for bug 6904 - clang allows redefinition of static const member

   As per your instructions to me in the cfe-dev group, I am posting
this patch to the cfe-commits group.


This patch is supposed to address the following bug:
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.
Faisal Vali

int-static-var-redef-bug-2.patch (4.97 KB)