Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clang] Accepts invalid constructor declaration with an asterisk #121706

Open
MagentaTreehouse opened this issue Jan 5, 2025 · 3 comments
Open
Labels
accepts-invalid clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party

Comments

@MagentaTreehouse
Copy link
Contributor

struct A {
    *A();
};

See Compiler Explorer: https://compiler-explorer.com/z/ccf6rqenE

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 5, 2025
@pinskia
Copy link

pinskia commented Jan 5, 2025

Just FYI, GCC has a similar bug and was filed as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118306 (there was also a recent regression with an ICE when defaulting the constructor which the reporter here reported to GCC as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118304 ).

@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" accepts-invalid and removed clang Clang issues not falling into any other category labels Jan 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 6, 2025

@llvm/issue-subscribers-clang-frontend

Author: None (MagentaTreehouse)

```c++ struct A { *A(); }; ``` See Compiler Explorer: https://compiler-explorer.com/z/ccf6rqenE

@shafik
Copy link
Collaborator

shafik commented Jan 7, 2025

Fun to note it accepts any number of asterisks: https://compiler-explorer.com/z/naaP75err

struct A {
    ******************A();
};

we can bring the whole gang along: https://compiler-explorer.com/z/TY8aq8G9W

struct A {
    ****A();
    ***~A();
    **A(const A&);
    *A(A&&);
};

goes back to clang-2.6: https://compiler-explorer.com/z/zWv4b45s7

@shafik shafik added the confirmed Verified by a second party label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts-invalid clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party
Projects
None yet
Development

No branches or pull requests

5 participants