llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[Clang] Accepts invalid alias template with the same name as its template parameter

Open MagentaTreehouse opened this issue 1 year ago • 5 comments

template <class T>
using T = int;

This is rejected by GCC, MSVC and EDG.

See https://compiler-explorer.com/z/6a5jWGn4s.

MagentaTreehouse avatar Jan 17 '25 23:01 MagentaTreehouse

@llvm/issue-subscribers-clang-frontend

Author: None (MagentaTreehouse)

```c++ template <class T> using T = int; ```

This is rejected by GCC, MSVC and EDG.

See https://compiler-explorer.com/z/6a5jWGn4s.

llvmbot avatar Jan 17 '25 23:01 llvmbot

Confirmed, violates this rule.

zygoloid avatar Jan 18 '25 01:01 zygoloid

Hi folks!

I am interested in solving this issue, but I haven't contributed anything to the upstream Clang project yet and I see that this issue is not marked as a "good first issue".

However, I do have some basic experience with building, testing, and changing some experimental fork of Clang.

Is it fine for me to pick up this task or do you have other processes and expectations in Clang project?

P.S. Sorry for noob question :)

BaLiKfromUA avatar Jan 18 '25 12:01 BaLiKfromUA

Is it fine for me to pick up this task?

Of course! Here is some documentation https://llvm.org/docs/Contributing.html

In addition of the code change you should provide

  • A sufficiently detailed description/commit message
  • Tests (in clang/tests)
  • A release note in clang/docs/ReleaseNotes.rst under "bug fixes to c++ support"

I hope this help

cor3ntin avatar Jan 18 '25 13:01 cor3ntin

Thank you!

I will look on this issue

BaLiKfromUA avatar Jan 18 '25 13:01 BaLiKfromUA