summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestProto.cpp
diff options
context:
space:
mode:
authorPaul Hoad <mydeveloperday@gmail.com>2019-03-23 14:24:30 +0000
committerPaul Hoad <mydeveloperday@gmail.com>2019-03-23 14:24:30 +0000
commita87ba1c59cb9f3381216cfe4e1a6a1e5425225ca (patch)
treec5eed4ec27b42d9047c632fd1da440aff69240c1 /clang/unittests/Format/FormatTestProto.cpp
parentc7ba9555cf1f4eb49e03428f60f1dd2cdb5b78c4 (diff)
downloadbcm5719-llvm-a87ba1c59cb9f3381216cfe4e1a6a1e5425225ca.tar.gz
bcm5719-llvm-a87ba1c59cb9f3381216cfe4e1a6a1e5425225ca.zip
[clang-format] correctly format protobuf fields named "enum".
Summary: Similar to TypeScript, "enum" is not a reserved word. Reviewers: krasimir, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: MyDeveloperDay, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D59629 Patch by: dchai (Donald Chai) llvm-svn: 356833
Diffstat (limited to 'clang/unittests/Format/FormatTestProto.cpp')
-rw-r--r--clang/unittests/Format/FormatTestProto.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp
index f4196f731f6..d5683b5b844 100644
--- a/clang/unittests/Format/FormatTestProto.cpp
+++ b/clang/unittests/Format/FormatTestProto.cpp
@@ -107,6 +107,12 @@ TEST_F(FormatTestProto, FormatsEnums) {
"};");
}
+TEST_F(FormatTestProto, EnumAsFieldName) {
+ verifyFormat("message SomeMessage {\n"
+ " required int32 enum = 1;\n"
+ "}");
+}
+
TEST_F(FormatTestProto, UnderstandsReturns) {
verifyFormat("rpc Search(SearchRequest) returns (SearchResponse);");
}
OpenPOWER on IntegriCloud