[cfe-commits] r121692 - in /cfe/trunk: include/clang/AST/Decl.h test/SemaCXX/return-stack-addr.cpp

Douglas Gregor dgregor at apple.com
Tue Dec 14 08:25:12 PST 2010


On Dec 12, 2010, at 11:40 PM, Chandler Carruth wrote:

> Author: chandlerc
> Date: Mon Dec 13 01:40:47 2010
> New Revision: 121692
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=121692&view=rev
> Log:
> 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.


I fully agree with your principled stance :)

	- Doug



More information about the cfe-commits mailing list