[cfe-commits] r86661 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Douglas Gregor dgregor at apple.com
Mon Nov 9 22:12:31 PST 2009


This won't get the right location if the parameter type involves  
something that goes after the declarator, e.g., a parameter of pointer- 
to-function type.

Sent from my iPhone

On Nov 9, 2009, at 7:32 PM, Anders Carlsson <andersca at mac.com> wrote:

> Author: andersca
> Date: Mon Nov  9 21:32:44 2009
> New Revision: 86661
>
> URL: http://llvm.org/viewvc/llvm-project?rev=86661&view=rev
> Log:
> Use PP.getLocForEndOfToken as suggested by John.
>
> Modified:
>    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=86661&r1=86660&r2=86661&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Mon Nov  9 21:32:44 2009
> @@ -268,8 +268,8 @@
>       // points to the '=' which means that the fixit hint won't  
> remove any
>       // extra spaces between the type and the '='.
>       SourceLocation Begin = NewParam->getLocation();
> -      if (IdentifierInfo *II = NewParam->getIdentifier())
> -        Begin = Begin.getFileLocWithOffset(II->getLength());
> +      if (NewParam->getIdentifier())
> +        Begin = PP.getLocForEndOfToken(Begin);
>
>       Diag(NewParam->getLocation(),
>            diag::err_param_default_argument_redefinition)
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list