Skip to content

Invalid attribute accepted dealing with # and ## operators #147217

@pinskia

Description

@pinskia

Forwarded from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120978 because clang is the only major compiler which accepts this (EDG, GCC and MSVC all reject this for having # and ## operators outside of macros).

[[ignored::ignored(##)]]int main(){}

The way I read the standard is during phase 4, this should be diagnostic as invalid. Which is exactly how GCC, EDG and MSVC all do as ## operator is invalid outside of the function like macros.

But I could be reading the spec wrong but with clang being the odd one out though; it looks more likely a clang issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partydiverges-from:edgDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions