[umbrello] [Bug 338649] Extend C++ import for C++11

"Oliver Kellogg" <[email protected]>
Newsgroups gmane.linux.umbrello.devel
Message-ID <[email protected]/>
https://bugs.kde.org/show_bug.cgi?id=338649

--- Comment #19 from Oliver Kellogg <[email protected]> ---
Git commit 464c7132349e4cf10a84fc9e6f3792087a934158 by Oliver Kellogg.
Committed on 30/04/2021 at 19:11.
Pushed by okellogg into branch 'release/21.04'.

Support C++11 "enum class" in C++ Import:

lib/cppparser/ast.{h,cpp} class EnumSpecifierAST
- Add functions setClass, isClass accessing new member m_isClass of type
  bool.
- Add functions setEnumBase, enumBase accessing new member m_enumBase
  of type TypeSpecifierAST::Node.

lib/cppparser/parser.cpp function parseEnumSpecifier
- Add bool isClass initialized to false.
- After consuming Token_enum add int tk initialized to
  m_lexer->lookAhead(0).
- If tk is Token_class or Token_struct then set isClass true and call
  nextToken().
- After call to parseName(name) add variable enumBase of type
  TypeSpecifierAST::Node.
- If m_lexer->lookAhead(0) is ':' then call nextToken() followed by
  parseSimpleTypeSpecifier(enumBase).
- Reassign tk from m_lexer->lookAhead(0) and permit only ';' or '{' as
  its value.
- Remove call to nextToken(), it is postponed to after the assignments
  to `ast'.
- At assignments to `ast' call ast->setClass(isClass) and
  ast->setEnumBase(enumBase).

test/import/cxx/cxx11-strongly-typed-enumerations.h
- Rename second definition of Enum2,Enum3 to Enum4,Enum5 to avoid
  overlap.

M  +12   -0    lib/cppparser/ast.cpp
M  +12   -0    lib/cppparser/ast.h
M  +40   -20   lib/cppparser/parser.cpp
M  +5    -4    test/import/cxx/cxx11-strongly-typed-enumerations.h

https://invent.kde.org/sdk/umbrello/commit/464c7132349e4cf10a84fc9e6f3792087a934158

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.