AntonBikineev marked an inline comment as done.
AntonBikineev added inline comments.


================
Comment at: 
clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp:45
+          isDefaulted(),
+          unless(anyOf(isFirstDecl(), isVirtual(),
+                       ofClass(cxxRecordDecl(
----------------
gribozavr2 wrote:
> The "isFirstDecl" part probably will always work, however, it is semantically 
> not really the right predicate to check. What we want to check is where the 
> constructor is declared -- in the class or outside the class, correct? If so, 
> then the matcher should be looking at the DeclContext of the constructor decl.
Thanks for the comment.
> What we want to check is where the constructor is declared -- in the class or 
> outside the class, correct? 
I was following the Standard's wording, which says that trivial destructor is 
not user-provided, where [[ 
http://eel.is/c++draft/dcl.fct.def.default#def:user-provided | user-provided ]] 
means
> user-declared and not explicitly defaulted or deleted on its **first 
> declaration**.
Technically, I think both ways should work as C++ doesn't allow more than 2 
special function declarations.


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

https://reviews.llvm.org/D69435



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to