Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gcc
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 39
    • Merge requests 39
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gcc-mirror
  • gcc
  • Merge requests
  • !68

Improve diagnostics for void conversions

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Ed Catmur requested to merge github/fork/ecatmur/ought-to-be into master Jul 08, 2022
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 8

'void value not ignored as it ought to be' is a holdover from K&R C and is utterly incomprehensible to the modern C++ developer. Switch to 'invalid use of void expression' / 'cannot convert (%qE from) %<void%> to ' (already in use in cp/call.cc etc.) and add context/expected type information where available.

gcc is inconsistent in tense between "cannot" / "could not"; using "cannot" where it looks more consistent.

Omit misleading range labels where loc is unknown, e.g. in void() ? x : y (o/w the caret points to y, implying that gcc thinks that y is void).

Pretty print the void_cst as void() instead of (void)0. This conforms to C++ e.g. in [dcl.type.auto.deduct], [temp.variadic].

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/ecatmur/ought-to-be