[PATCH] Clean up some existing keyword tests in the test/Lexer directory

Richard Smith richard at metafoo.co.uk
Mon May 5 15:04:46 PDT 2014


FYI, Phabricator doesn't send mail when you change the CC's on a review, so no-one was informed that this change existed until just now.

LGTM, thanks!

================
Comment at: test/Lexer/keywords_test.cpp:4-5
@@ +3,4 @@
+
+#define IS_KEYWORD(NAME) _Static_assert(!__is_identifier(NAME), #NAME)
+#define NOT_KEYWORD(NAME) _Static_assert(__is_identifier(NAME), #NAME)
+
----------------
It might be nice to also have an `IS_TYPE`, and check there that tentative parsing knows that the keyword is a type. Something like:

  #define IS_TYPE(NAME) void is_##TYPE##_type() { int(f(TYPE)); } // ok, function declaration

http://reviews.llvm.org/D3460






More information about the cfe-commits mailing list