Skip to content

Implement fixits for malformed 'main' declaration #8476

Closed
@ggreif

Description

@ggreif
Bugzilla Link 8104
Version trunk
OS All
CC @dwblaikie,@gribozavr

Extended Description

[7:30pm] gabor: dgregor: FixIt idea: error: C++ requires a type specifier for all declarations
[7:30pm] gabor: main (int , const char * argv [])
[7:30pm] gabor: ^--- "int "

Since main must return "int" this is an always applicable fixit.

I am not so sure with the main arguments

  • either "int main(void)" in C++ also "int main()"
  • or "int main(int argc, const char* argv[])"

But these are often mis-declared, so a fixit would be useful too.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions