Bug 21451 – __traits(compiles, ...) is wrong on overloaded templates instantiated with empty parens

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-12-03T19:56:33Z
Last change time
2024-12-13T19:13:15Z
Keywords
pull
Assigned to
No Owner
Creator
Bolpat
Moved to GitHub: dmd#19834 →

Comments

Comment #0 by qs.il.paperinik — 2020-12-03T19:56:33Z
Since 2.064, the assert with // ??? succeeds. From 2.060 to 2.063, the respective assert fails as expected. void f(int a : 1)() { } void f(int b : 2)(int x) { } void main() { static assert( __traits(compiles, f!1 )); static assert( __traits(compiles, f!1() )); static assert( __traits(compiles, f!2(2) )); static assert(!__traits(compiles, f!(1, 2) )); static assert( __traits(compiles, f!() )); // ??? static assert(!__traits(compiles, { f!(); })); } The marked assert shouldn't compile.
Comment #1 by jlourenco5691 — 2021-01-23T20:10:20Z
*** Issue 21576 has been marked as a duplicate of this issue. ***
Comment #2 by dlang-bot — 2021-02-11T15:45:50Z
@RazvanN7 created dlang/dmd pull request #12192 "Fix Issue 21451 - __traits(compiles, ...) is wrong on overloaded temp…" fixing this issue: - Fix Issue 21451 - __traits(compiles, ...) is wrong on overloaded templates instantiated with empty parens https://github.com/dlang/dmd/pull/12192
Comment #3 by robert.schadek — 2024-12-13T19:13:15Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19834 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB