[Issue 22053] New: `catch {` not rejected while in a template
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jun 20 21:27:18 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22053
Issue ID: 22053
Summary: `catch {` not rejected while in a template
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dlang-bugzilla at thecybershadow.net
/////// test.d ///////
void foo()()
{
try {}
catch
assert(false);
}
alias goo = foo!();
//////////////////////
This catch syntax (without specifying an exception) has been deprecated and is
currently rejected when the code is not in a function template. However, the
compiler does not reject it when it's inside a template, even when the template
is instantiated.
--
More information about the Digitalmars-d-bugs
mailing list