[cfe-dev] Fixits for invalid main declarations

Douglas Gregor dgregor at apple.com
Fri Aug 26 17:16:48 PDT 2011


On Aug 26, 2011, at 2:25 PM, David Blaikie wrote:

> So I thought I'd try my hand at some bugs & I found this:
> http://llvm.org/bugs/show_bug.cgi?id=8104
> 
> But I thought I'd just start at the top (of Sema::CheckMain (in
> SemaDecl.cpp)) & see about adding fixits to all the various warnings &
> errors I came across.
> 
> The first one is a warning (error in C++) for main being declared
> inline or static. But I can't seem to figure out how to get the
> SourceRange of the static/inline keyword from the FunctionDecl. Is
> this possible? Could someone point me to the right place to find those
> SourceRanges?
> 
> [I have a sneaking suspicion that maybe this level of source
> information isn't kept through to semantic analysis here... ]


I don't think we maintain that information in the FunctionDecl. It's in the DeclSpec, if it's still hanging around.

	- Doug



More information about the cfe-dev mailing list