[cfe-dev] How to tell if a CXXMethodDecl is const-qualified?

Douglas Gregor dgregor at apple.com
Mon Oct 17 12:44:21 PDT 2011

On Oct 17, 2011, at 12:22 PM, John Freeman wrote:

> Either Method->getType().isConstQualified() isn't what I want, or I'm 
> building my CXXMethodDecl incorrectly. How is const-ness indicated when 
> building CXXMethodDecl?

The qualifiers on a method aren't cv-qualifiers on the type, which is a fairly common source of confusion. If you cast down to a FunctionProtoType, you'll see that it has qualifiers. Or, just use CXXMethodDecl::getTypeQualifiers().

	- Doug

More information about the cfe-dev mailing list