[PATCH] Formatting 'enum class' and 'enum struct' as enumerations

Joe Hermaszewski expipiplus1 at gmail.com
Tue May 28 06:00:04 PDT 2013


Hi djasper,

This simply reads over a 'class' or 'struct' token in parseEnum.

http://llvm-reviews.chandlerc.com/D876

Files:
  lib/Format/UnwrappedLineParser.cpp

Index: lib/Format/UnwrappedLineParser.cpp
===================================================================
--- lib/Format/UnwrappedLineParser.cpp
+++ lib/Format/UnwrappedLineParser.cpp
@@ -860,6 +860,10 @@
 
 void UnwrappedLineParser::parseEnum() {
   nextToken();
+  // Eat up enum class ...
+  if (FormatTok.Tok.is(tok::kw_class) ||
+      FormatTok.Tok.is(tok::kw_struct))
+      nextToken();
   if (FormatTok.Tok.is(tok::identifier) ||
       FormatTok.Tok.is(tok::kw___attribute) ||
       FormatTok.Tok.is(tok::kw___declspec)) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D876.1.patch
Type: text/x-patch
Size: 538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130528/7411fd81/attachment.bin>


More information about the cfe-commits mailing list