aaron.ballman added a comment.

I dreamed up some test cases that may or may not make sense. I think they boil 
down to a few things:

- Does inheriting from a prohibited type still diagnose when the derived type 
is used to construct a temporary?
- Should it still be prohibited if the temporary type is being returned?

Comment at: clang-tidy/zircon/ZirconTidyModule.cpp:29
+// Register the ZirconTidyModule using this statically initialized variable.
+static ClangTidyModuleRegistry::Add<ZirconModule>
Can you add a bit of vertical whitespace before this comment?

Comment at: test/clang-tidy/zircon-temporary-objects.cpp:82
+} // namespace NS
Some additional test cases:
template <typename Ty>
Ty make_ty() { return Ty{}; }

// Call make_ty<> with two types: one allowed and one disallowed; I assume only 
the disallowed triggers the diagnostic.

struct Bingo : NS::Bar {}; // Not explicitly disallowed

void f() {
  Bingo{}; // Should this diagnose because it inherits from Bar?

// Assuming derived classes diagnose if the base is prohibited:
template <typename Ty>
struct Quux : Ty {};

void f() {
  Quux<NS::Bar>{}; // Diagnose
  Quux<Bar>{}; // Fine?


cfe-commits mailing list

Reply via email to