From 2412cfac512cbf54ebd379ee8d7157b251f4932d Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 1 Mar 2019 09:38:45 +0100 Subject: moc: Fix parsing of [[deprecated]] enum values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit moc now successfully parses enum values, that have been deprecated with [[deprecated]]. This is valid c++17 and should be handled correctly. By adding that functionality it is possible to parse Windows headers which use this deprecation mechanism. To make sure, that moc works correctly even on compilers that do not support deprecated enum values yet, the auto test explicitly uses [[deprecated]] enum values during moc run. Fixes: QTBUG-74126 Change-Id: I7b9d9a49af6093a97f8fdb800ffbc5af3d54d262 Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Jędrzej Nowacki --- src/tools/moc/moc.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index d811bf09f0..2f52dd6ca0 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -285,6 +285,7 @@ bool Moc::parseEnum(EnumDef *def) break; next(IDENTIFIER); def->values += lexem(); + skipCxxAttributes(); } while (test(EQ) ? until(COMMA) : test(COMMA)); next(RBRACE); if (isTypdefEnum) { -- cgit v1.2.3