Skip to content

Invocation of operator ++ does not get a location #11564

Closed
@llvmbot

Description

Bugzilla Link 11192
Resolution FIXED
Resolved on Feb 07, 2012 20:35
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @akyrtzi,@DougGregor,@tkremenek

Extended Description

If you run this you can see that the invocations of operator ++ gets 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: :0:0: DeclRefExpr=operator++:6:7
a++; // CHECK: :0:0: DeclRefExpr=operator++:11:7
a << 23; // CHECK: file.cpp:29:5: DeclRefExpr=operator<<:16:7
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions