__attribute__((weak)) possible regression in clang 3.6 since 3.5

Whilst compiling RxCpp with clang 3.6 I get this error (and lots more very similar):
`.text.startup' referenced in section `.text.startup' of CMakeFiles/rxcppv2_test.dir/home/ben/development/test/rxcpp/RxCpp/Rx/v2/test/subscriptions/subscription.cpp.o: defined in discarded section `.text.startup[_ZN5rxcpp22composite_subscription12shared_emptyE]' of CMakeFiles/rxcppv2_test.dir/home/ben/development/test/rxcpp/RxCpp/Rx/v2/test/subscriptions/subscription.cpp.o

shared_empty is declared like this, in a header file:
__attribute__((weak)) composite_subscription composite_subscription::shared_empty = composite_subscription(detail::tag_composite_subscription_empty());

I don't know if that's valid or not. If it's not, what should it be? It compiles with gcc-4.9.2, gcc-4.6.3, clang-3.4 and clang-3.5, that I'm aware of.



Can you report a bug with a preprocessed file that shows the warning?
Or at least detailed instructions on how to build RxCpp?


I went with build instructions as I don't know how to create the preprocessed file, as it has to link a lot of files together, and besides, they're huge.


Optimisation affects the result, and it appears to only be on the 3.6 branch.

clang version 3.7.0 (trunk 229351)
-O0, -02 succeeds

clang version 3.6.0 (branches/release_36 229488)
-O0, -O1 fails, -O2, -O3 succeeds

clang version 3.6.0 (branches/release_36 229639)
-O0 fails, -O2 succeeds

clang version 3.7.0 (trunk 229639)
-O0 succeeds