hfinkel added a comment.

In https://reviews.llvm.org/D31413#712013, @aaron.ballman wrote:

> I'm not certain of a good way to test it, but I have a question about the 
> value you picked for `init_priority`. My understanding of the values starting 
> from 101 is that 1-100 are reserved for implementation use. Is that 
> understanding correct? If so, you may want to pick a value below 100 to 
> ensure there's not an arms race with the user. I believe this may require 
> some alteration to SemaDeclAttr.cpp to not diagnose when this is coming from 
> a system header. Otherwise, what's to stop the user from having something 
> marked `constructor(101)` that attempts to use a stream, but can't because 
> they're not initialized yet?


I agree; using 100 probably makes sense here. By spec, that's before any 
regular user code might execute.

Regarding testing, it is easy to test this (i.e. use cout/cerr/etc. from a 
constructor of a global object) if you link with libc++.a. Maybe just add a 
simple test and then we can see about setting up a buildbot which builds/tests 
a static libc++?


https://reviews.llvm.org/D31413



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to