Closed bluetarpmedia closed 6 months ago
Thanks! I think it's still a tossup whether this special case is worth saving people writing cpp2::
, but I think the principle does apply that there's nothing else the programmer could mean given that new
is a Cpp1 reserved word.
Describe the bug Cppfront is not emitting the
cpp2
namespace qualifier onunique
orshared
when writingunique.new
orshared.new
. I seem to remember this working a long time ago so I wonder if UFCS refactoring has affected it.To Reproduce Run cppfront on this code:
This lowers to:
Then compile with a C++ compiler. It will report an error along the lines of:
use of undeclared identifier 'unique'; did you mean 'cpp2::unique'?
See Godbolt
Additional context Regular
new<int>
works correctly. It's onlyunique.new
orshared.new
that has a problem. I couldn't find any regression tests withunique.new
orshared.new
so that's probably worth adding as part of the fix for this.