r285979 - Do not print enum underlying type if language is not C++11

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 4 05:50:06 PDT 2016


This following commit r285981 (Enhancement to test for -ast-print tests)
tests this change. Without it the test 'Coverage/ast-printing.c' fails on
Windows.

Thanks,
--Serge

2016-11-04 19:09 GMT+07:00 Aaron Ballman <aaron at aaronballman.com>:

> On Fri, Nov 4, 2016 at 2:03 AM, Serge Pavlov via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > Author: sepavloff
> > Date: Fri Nov  4 01:03:34 2016
> > New Revision: 285979
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=285979&view=rev
> > Log:
> > Do not print enum underlying type if language is not C++11
> >
> > Output generated by option '-ast-print' must not contains enum
> > base type specifications if source language does not include C++11.
> >
> > Modified:
> >     cfe/trunk/lib/AST/DeclPrinter.cpp
>
> Test case?
>
> ~Aaron
>
> >
> > Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
> > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/
> DeclPrinter.cpp?rev=285979&r1=285978&r2=285979&view=diff
> > ============================================================
> ==================
> > --- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
> > +++ cfe/trunk/lib/AST/DeclPrinter.cpp Fri Nov  4 01:03:34 2016
> > @@ -407,7 +407,7 @@ void DeclPrinter::VisitEnumDecl(EnumDecl
> >    }
> >    Out << *D;
> >
> > -  if (D->isFixed())
> > +  if (D->isFixed() && D->getASTContext().getLangOpts().CPlusPlus11)
> >      Out << " : " << D->getIntegerType().stream(Policy);
> >
> >    if (D->isCompleteDefinition()) {
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161104/89351206/attachment.html>


More information about the cfe-commits mailing list