[LLVMbugs] [Bug 18302] New: Rewriter: CallExpr sometimes has wrong LocEnd

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Dec 21 02:38:22 PST 2013


            Bug ID: 18302
           Summary: Rewriter: CallExpr sometimes has wrong LocEnd
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: noelgrandin at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I have some code that looks like:
   SvStream& operator<<( SvStream& rOStream )
       sal_uInt16 nColorName   = 0;
       sal_uInt16 nRed         = 1;
       sal_uInt16 nGreen       = 2;
       sal_uInt16 nBlue        = 3;
       rOStream << nColorName;
       rOStream << nRed;
       rOStream << nGreen;
       rOStream << nBlue;

       return rOStream;

And when I use a clang rewriter that attempts to modify the << operator
expression like this:

   bool SvStreamOutputOperators::VisitCallExpr( const CallExpr* callExpr )
       insertTextAfter( callExpr->getLocEnd(), ")" );

I get this:
       rOStream << )nColorName;
       rOStream << )nRed;
       rOStream << )nGreen;
       rOStream << )nBlue;

This doesn't always happen - it's only on a few expressions that the AST seems
to be generating incorrect end locations.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131221/bfc73778/attachment.html>

More information about the llvm-bugs mailing list