https://bugs.llvm.org/show_bug.cgi?id=50735

Allen zhong <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|REOPENED                    |RESOLVED

--- Comment #4 from Allen zhong <[email protected]> ---
thanks, you are right, I verify with following change as you show, it indeed
can modify 'bins[0]'


class NPair /*: protected Pointers */ {
public:
  int bins[10];
  //int exclusion(int n) __attribute__((const));
  int exclusion (int n) const {
        printf ("before %d\n", bins[0]);
    NPair* pt = const_cast<NPair*>(this);
    pt->bins[0] = 1;
        printf ("after %d\n", bins[0]);
  }
  NPair (void) {
     bins[0] = 3;
  }
};

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to