]> granicus.if.org Git - clang/commit
Allow a pointer implicitly cast to a bool as a constant expression, as
authorEli Friedman <eli.friedman@gmail.com>
Fri, 30 May 2008 18:14:48 +0000 (18:14 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 30 May 2008 18:14:48 +0000 (18:14 +0000)
commitc1cc6dccd42b91a2ebb397415940da91dbf36103
tree858115730dcbb0e11028e4d34f8c652ebb3f86e6
parentf8f873deef78de611dd793a1e1201bef0d5a54a3
Allow a pointer implicitly cast to a bool as a constant expression, as
required by the standard (the standard doesn't know anything about
implicit casts).

Disallow pointers cast to non-integral arithmetic types as constant
expressions.  This was previously allowed by accident.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51779 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/Sema/static-init.c