[cfe-commits] Modulo renaming [WAS: r60615 ...]

Eli Friedman eli.friedman at gmail.com
Wed Dec 10 16:23:06 PST 2008


On Wed, Dec 10, 2008 at 4:07 PM, Douglas Gregor <dgregor at apple.com> wrote:
>> If you have a system that is strong enough to know that (+) is
>> commutative,
>> then nominal unification should be able to prove the equivalence of
>>
>> template<int I, int J> void f(int (&array)[J+I]);
>> template<int X, int Y> void f(int (&array)[X+Y]);
>
> Thankfully,  determining that those two function templates are
> functionally equivalent but not equivalent (per C++ [temp.over.link]
> p7) is in the realm of "ill-formed, no diagnostic required." Of
> course, a "high quality implementation" would detect such errors...

Also, we need to preserve the form of the original expression tree in
the canonical type: AFAIK, doing name mangling in a compatible way
requires it.

-Eli



More information about the cfe-commits mailing list