[cfe-dev] Patch: Store brackets for C++ array subscripbtion

Erik Verbruggen erik.verbruggen at me.com
Tue Jun 7 02:44:50 PDT 2011


Hello,

Attached is a patch to store the location of the brackets for calls to array subscription expressions when the caller is a C++ operator:

struct Foo {
  int operator[](int);
  static void mooze() {
    Foo bar;
    bar[1];   // <--- this call
    bar[](1); // <--- not this call
  }
};

I tried to make the least intrusive patch as possible, but I am not sure if there are more cases where the DeclRefExpr should store a DeclarationNameLoc then only the overloaded array subscription.

Cheers,
Erik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110607/f749c6a5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: store-brackets.patch
Type: application/octet-stream
Size: 2122 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110607/f749c6a5/attachment.obj>


More information about the cfe-dev mailing list