Skip to content

__builtin_types_compatible_p does not take in account noreturn attributes #7325

@Abramo-Bagnara

Description

@Abramo-Bagnara
Bugzilla Link 6953
Version trunk
OS Linux
CC @efriedma-quic

Extended Description

This code compiles in gcc, but not in clang due to different result.

The two types are considered incompatible by gcc and compatible by clang.

typedef void (*f1)();
typedef void (*f2)() __attribute__ ((noreturn));

int p() {
  int a[1 - __builtin_types_compatible_p(f1, f2) * 2];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions