[LLVMbugs] [Bug 11310] New: const pointers to instances is allowed to modify the instance it points

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 4 07:05:10 PDT 2011


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

             Bug #: 11310
           Summary: const pointers to instances is allowed to modify the
                    instance it points
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: muthuveerappan.al at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 7575
  --> http://llvm.org/bugs/attachment.cgi?id=7575
example showing that the const pointers are allowed to modify the instance it
points to

It happens in the following 2 cases:
1) even if you explicitly specify the class type and specify "const"
2) when you you "cons id" as the data type

Overview
=======
const pointer should not be allowed to be modify the instance it points to

Actual Behavior
============
const pointer is allowed to be modify the instance it points to

Expected Behavior
=============
const pointer shouldn't be allowed to be modify the instance it points to.

Example:
========
The example attached shows the 3 cases of using const pointers.
In 2 cases, no error is thrown and in 1 case error is thrown and seems
inconsistent

-- 
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