mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

This has some changes to error messages which should be reviewed. The segfaulting-patterns were contributed by mayonix.
50 lines
873 B
D
50 lines
873 B
D
// https://issues.dlang.org/show_bug.cgi?id=23351
|
|
enum strings =
|
|
[
|
|
"a[(b).",
|
|
"[(a)(b).",
|
|
"a(={@.()(",
|
|
"a[b,[(c).",
|
|
"a[b#([(c).",
|
|
"[a@b[(c).",
|
|
"[((a).",
|
|
"[a)b[(c).",
|
|
"a[b)[(c).",
|
|
"a(b[(c).",
|
|
"a[b()c[(d).",
|
|
"a[(b[(c).",
|
|
"a(b[(c).",
|
|
"[(@@a b[(c).",
|
|
"a[(!b)c[(d).",
|
|
"[(^a)b[(c).",
|
|
"a(b[(c).",
|
|
"~[a.b[(c).",
|
|
"[a).[(b c d(e[(f).",
|
|
"[((a).",
|
|
"[a}b[(c).",
|
|
"a[b[c..(d).",
|
|
"[1a.[(b).",
|
|
"a[({in){,",
|
|
"a[^in(b[c=])S....,",
|
|
"a[({in[({)){,"
|
|
];
|
|
template KidNamedFinger(T)
|
|
{
|
|
|
|
}
|
|
void dummy()
|
|
{
|
|
static foreach(str; strings)
|
|
{
|
|
/*
|
|
The above strings are all gibberish, they should
|
|
fail to parse but not segfault the compiler.
|
|
*/
|
|
{
|
|
enum exp = __traits(compiles, mixin(str));
|
|
static assert(!exp);
|
|
enum t = __traits(compiles, KidNamedFinger!(mixin(str)));
|
|
static assert(!t);
|
|
}
|
|
}
|
|
}
|