[PATCH] D57852: [clang-tidy] Don't use assignment for value-initialized enums

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 7 02:40:52 PST 2019


JonasToth added a comment.

How are the semantics for `enum class` in this case?



================
Comment at: clang-tools-extra/test/clang-tidy/modernize-use-default-member-init-assignment.cpp:172
+  // CHECK-FIXES: PositiveValueEnum()  {}
+  Enum e;
+  // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: use default member initializer for 'e'
----------------
What happens for the case `enum Enum { Foo = 3 }; /* ... */ : e() /* ... */`, is that even well formed?
I feel a testcase along those lines is missing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57852/new/

https://reviews.llvm.org/D57852





More information about the cfe-commits mailing list