On Mon, Jul 14, 2014 at 09:50:34AM -0400, Jason Merrill wrote:
> >>/daten/aranym/gcc/gcc-20140714/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1:
> >> error: non-constant condition for static assertion
> >>/daten/aranym/gcc/gcc-20140714/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1:
> >> error: '(f != 0u)' is not a constant expression
> >
> >Ah, sorry, missed this one.  I think the error is correct (based on earlier 
> >discussion we can
> >not really expect addresses of symbols to be non-NULL), so I would just 
> >update the testcase?
> 
> Hmm.  I think the C++ standard says this is constant, and of course whether
> an expression is constant is more significant in C++ because of templates
> and constexpr.  clang doesn't give this error, EDG does.
> 
> For C++, my inclination would be to say that if a symbol is declared weak,
> it needs to be declared weak before the first use, just like inline
> functions.

I'd say that even for C we should require that, and thus for
non-weak symbols expect they are non-NULL, unless
-fno-delete-null-pointer-checks tells us not to.

        Jakub

Reply via email to