Skip to content

const pointers to instances is allowed to modify the instance it points #11682

@llvmbot

Description

@llvmbot
Bugzilla Link 11310
Resolution INVALID
Resolved on Nov 04, 2011 12:30
Version unspecified
OS MacOS X
Attachments example showing that the const pointers are allowed to modify the instance it points to
Reporter LLVM Bugzilla Contributor

Extended Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillainvalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions