Skip to content

[SUGGESTION] Ability to disable UFCS both via cppfront and for regions in source code #1004

Closed
@bluetarpmedia

Description

@bluetarpmedia

I'd like the ability to disable UFCS with 2 mechanisms:

  1. A new switch on cppfront to control whether UFCS is enabled (defaults to true) for a whole Cpp2 file
  2. Some kind of #pragma push/pop or [[attribute]]-style code that cppfront would read when parsing the Cpp2 source code to control whether UFCS function calls are enabled for a region of code inside a Cpp2 file

Motivations:

  • Hopefully a temporary motivation, but there are some UFCS bugs which remain to be fixed, and I find myself having to add workarounds in the code when I encounter them, but it'd be easier to just disable UFCS.
  • The debugging experience with UFCS is not ideal (at least for me in VS) because it doesn't step over the function calls like I'd expect. See also [BUG] Poor debugging experience of generated code #844
  • I have to admit that I'm now on the fence as to the usefulness of UFCS. I started out firmly in the positive camp but have slowly moved to neutral. Right now I'd prefer an explicit opt-in type of UFCS (more like C# extension methods) rather than working globally, silently, and implicitly.

Will your feature suggestion eliminate X% of security vulnerabilities of a given kind in current C++ code?
No

Will your feature suggestion automate or eliminate X% of current C++ guidance literature?
No

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions