[cfe-dev] @encode() discrepancy between C++11 and earlier

Duncan P. N. Exon Smith via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 12 13:44:05 PST 2020


Hi Nico,

Thanks for reaching out. Michael Spencer is probably the best contact for this kind of question these days; I’ve cc’ed him.

Duncan

> On 2020-11-12, at 09:04, Nico Weber <thakis at chromium.org> wrote:
> 
> Hi,
> 
> http://reviews.llvm.org/D76801 <http://reviews.llvm.org/D76801> changed clang/lib/AST/TypePrinter.cpp to not print a space between consecutive '>'s in templates if targeting C++11 or later.
> 
> I noticed recently that this affects Objective-C's @encode too, which means it has different results based on language standard, making it impossible to build part of a program with C++98 and another part with C++11 (...if both parts need @encode if some common type to agree). It also means @encode for types changed with that patch, which is an ABI break of sorts.
> 
> However, the change landed in March, so maybe it's already deployed in new Xcodes.
> 
> Should we make @encode opt out of this pretty printing change to restore the old behavior? (Several other places also broke due to that change and were changed to opt out -- debug info, for example).
> 
> I found this while writing tests for an unrelated change [1] and I don't know of any projects adversely affected by this.
> 
> Nico
> 
> 
> 1: See "FIXME" in https://reviews.llvm.org/D90622#change-Aht3gYP3AIRe <https://reviews.llvm.org/D90622#change-Aht3gYP3AIRe>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20201112/005c800d/attachment.html>


More information about the cfe-dev mailing list