[LLVMbugs] [Bug 11192] New: Invocation of operator ++ does not get a location

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 20 08:09:20 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=11192

           Summary: Invocation of operator ++ does not get a location
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hans.walheim at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


If you run this you can see that the invocations of operator ++ gets <invalid
loc> while operator << has a valid location
=====
// Command line: c-index-test -test-load-source all file.cpp

struct A
{
  int value;
  A & operator ++ ()            // preincrement
    {   
    value += 1;
    return (*this);
    }
  A & operator ++ (int)         // postincrement
    {   
      value += 2;
      return (*this);
    }
  A & operator << (int rhs)
    {
      value = 23;
      return (*this);
    }
};

A a;

void func (void)
{
  ++a;          // CHECK: <invalid loc>:0:0: DeclRefExpr=operator++:6:7
  a++;          // CHECK: <invalid loc>:0:0: DeclRefExpr=operator++:11:7
  a << 23;      // CHECK: file.cpp:29:5: DeclRefExpr=operator<<:16:7
}
=====

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list