Re:Parsing C++ is literally undecidable (2013)
by john_moscow on Friday October 04, 2019 @02:49PM
(#21160692)
Yeah, good luck with this one then:
[ Parent
| on HN ]
Re:Parsing C++ is literally undecidable (2013)
by fusilli_jerry on Friday October 04, 2019 @02:58PM
(#21160793)
This is still not ambiguous: in order for 'foo::a' to be a template, 'a' must be prefixed with the 'template' disambiguator keyword, and in fact for any of a, b, or c to be types at all they would have to be prefixed with 'typename'. As written, it must parse as two expressions; if 'foo::a' turns out to be a class template at instantiation time, it's an error.
Re:Parsing C++ is literally undecidable (2013)
by MauranKilom on Saturday October 05, 2019 @07:05PM
(#21168573)
Two-phase lookup requires this to be interpreted at template parse time as two comparisons and a comma operator, because a, b and c are dependent names (which, without further disambiguation with the typename or template keyword, are taken to be variables). This has been the case since the first ISO C++ standard (published in 1998).