Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pike
pike
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 105
    • Issues 105
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • pikelang
  • pikepike
  • Issues
  • #1858

Closed
Open
Opened Jul 10, 2001 by Peter Bortas@zinoOwner

this_object() in constants

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=1858

Reported by Martin Stjernholm mast@roxen.com

Consider:

    constant foo = ({this_object()});

    int main()
    {
      werror ("%O %O\n", foo, foo[0] == this_object());
    }

This prints "({0})" in 7.2 and later. I expected either an error due to a nonconstant expression used in constant, or, if it somehow works anyway, an array with this_object() in it.

Interestingly enough, the array contains an object in 7.0, but it's not the same as this_object().

Assignee
Assign to
Pike 7.2
Milestone
Pike 7.2
Assign milestone
Time tracking
None
Due date
None
Reference: pikelang/pike#1858