]> granicus.if.org Git - clang/commit
Fix PR8774 by restricting when hasInit returns true. Previously, it
authorChandler Carruth <chandlerc@gmail.com>
Mon, 13 Dec 2010 07:40:47 +0000 (07:40 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 13 Dec 2010 07:40:47 +0000 (07:40 +0000)
commite7f85047d0dd5ebb03d851fab0afa9db07ec2925
tree4f504ec2f5c7d16a342152531b37ba6981642675
parent6a57746ea8e94aaf3fbcc961dc95756f5f3dda52
Fix PR8774 by restricting when hasInit returns true. Previously, it
would return true if the initializer pointer union had *any* non-null
pointer in it, even if the pointer wasn't one that would actually be
returned via getInit(). This makes it more accurately model the logic of
'getInit() != NULL'.

This still isn't completely satisfying. From a principled stance,
I suspect we should make hasInit() and getInit() *always* return false
and NULL (resp.) for ParmVarDecl. We shouldn't at the API level treat
initializers and default arguments as the same thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121692 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Decl.h
test/SemaCXX/return-stack-addr.cpp