Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 398
    • Issues 398
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2495
Closed
Open
Created Jun 05, 2025 by Sven-Bodo Scholz@sbsOwner

Return value type pattern does not enforce equality

In the following code, we should get identical behaviour irrespective of how the preprocessor condition is set:

#if 1
    int{n} foo ( int n)
#else
    int{m} foo ( int n) | _eq_SxS_(m, n)
#endif
{
   return _add_SxS_(n,1);
}

int main()
{
   return foo (42);
}

Both versions should fail but only the one with an explicit equality does, at least in sac2c 2.0.0-Tintigny-136-g7a4cd.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking