Skip to content

[C DR423] Clang does not use the unqualified version of return type for C17 program #39494

Open
@yeah-boi

Description

@yeah-boi
mannequin
Bugzilla Link 40147
Version trunk
OS All
CC @pascal-cuoq,@hfinkel,@zygoloid

Extended Description

Test case (prog.c):

  int main()
  {
    typedef const int t();
    typedef int t();
  }

Compilation command line:

  clang prog.c -Wall -Wextra -std=c11 -pedantic-errors 

Observed behaviour:

The following error message was outputed:

    error: typedef redefinition with different types ('int ()' vs
           'const int ()') typedef int t();

Expected behaviour:

No error message. Both typedefs should define t to be of type 'int ()' since
function types never have qualified return types.

Standard references:

6.7.6.3.5

Note:

gcc does not give any errors for the program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac11clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyrejects-valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions