[PATCH] D20821: Fix a few issues while skipping function bodies

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue May 31 10:41:02 PDT 2016


rsmith added inline comments.

================
Comment at: lib/Parse/ParseStmt.cpp:1989
@@ +1988,3 @@
+    if (Tok.is(tok::colon)) {
+      // skip constructor initializer list
+      SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch);
----------------
Comments should start with a capital letter and end with a period.

================
Comment at: lib/Parse/ParseStmt.cpp:1990
@@ +1989,3 @@
+      // skip constructor initializer list
+      SkipUntil(tok::l_brace, StopAtSemi | StopBeforeMatch);
+    }
----------------
This is not correct. Skipping constructor initializer lists correctly is hard (which is probably why we used to parse the initializer list rather than skipping it). You can use `Parser::ConsumeAndStoreFunctionPrologue` to get this (approximately) correct.


http://reviews.llvm.org/D20821





More information about the cfe-commits mailing list