Skip to content

[clang] Ungrammatical "a enum specifier" error message #94443

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

Closed
Rajveer100 opened this issue Jun 5, 2024 · 8 comments
Closed

[clang] Ungrammatical "a enum specifier" error message #94443

Rajveer100 opened this issue Jun 5, 2024 · 8 comments
Assignees
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer good first issue https://github.com/llvm/llvm-project/contribute

Comments

@Rajveer100
Copy link
Contributor

Rajveer100 commented Jun 5, 2024

Clang throws ungrammatical error message for alias.

GodBolt

Old:

error: type alias 'A' cannot be referenced with a enum specifier

New:

error: type alias 'A' cannot be referenced with the 'enum' specifier

This can be rephrased for other cases as well, ex:

template<class T> using A = int;
struct A s;
@github-actions github-actions bot added the clang Clang issues not falling into any other category label Jun 5, 2024
@cor3ntin cor3ntin added clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer good first issue https://github.com/llvm/llvm-project/contribute labels Jun 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 5, 2024

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor has already been assigned to this issue. If you believe that no one is actually working on it despite an assignment, ping the person. After one week without a response, the assignee may be changed.
  2. In the comments of this issue, request for it to be assigned to you, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

@llvmbot
Copy link
Member

llvmbot commented Jun 5, 2024

@llvm/issue-subscribers-good-first-issue

Author: Rajveer Singh Bharadwaj (Rajveer100)

Clang throws ungrammatical error message for alias.

GodBolt

Old:

error: type alias 'A' cannot be referenced with a enum specifier

New:

error: alias 'A' cannot be referenced with the 'enum' specifier

This can be changed similarly for other cases as well.

@EugeneZelenko EugeneZelenko removed the clang Clang issues not falling into any other category label Jun 5, 2024
@kper
Copy link
Contributor

kper commented Jun 5, 2024

I would like to take that :)

@akshaykumars614
Copy link
Contributor

I am new here, but the error message seems to be correct as A is a type alias here. But as I can see, it is being changed to alias. Please correct me if I am wrong. @Rajveer100

@Rajveer100
Copy link
Contributor Author

@akshaykumars614
Apologies, I have updated the issue description.

@Rajveer100
Copy link
Contributor Author

For the new snippet in the description, it would be applicable:

template<class T> using A = int;
struct A s;
Old: type alias template 'A' cannot be referenced with a struct specifier
New: alias template 'A' cannot be referenced with the 'struct' specifier

@kper
Copy link
Contributor

kper commented Jun 6, 2024

@Rajveer100 is the change from old to new just a grammar change or do I have to change the analysis?

Old: type alias template...
New: alias template...

@Rajveer100
Copy link
Contributor Author

It's a grammatical change.

kper added a commit to kper/llvm-project that referenced this issue Jun 6, 2024
Endilll pushed a commit that referenced this issue Jun 7, 2024
As discussed in #94443, this PR changes the wording to be more correct.
@HerrCai0907 HerrCai0907 mentioned this issue Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer good first issue https://github.com/llvm/llvm-project/contribute
Projects
None yet
Development

No branches or pull requests

6 participants