Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 15.1.2
#1
Hi,

We are having a discussion internally about how to interpret rule 15.1.2. In particular, the rule exception says that a class is considered empty "when it has [...], no virtual member functions, [...]".
The question is whether a virtual (defaulted) destructor is considered a virtual member function in this context. For example, whether the following class is considered empty or not for the sake of this rule:


Code:
struct Base () {
    virtual ~Base() = default;
};

My personal interpretation is that this class is not considered empty (it will contain the v-table), so it does not qualify as an exception w.r.t. rule 15.2 when used as a base class. Can you confirm that this interpretation is correct?

Thank you very much and b
est regards,
Daniel "Merge" Merget
Reply


Messages In This Thread
Rule 15.1.2 - by Merge - 19-02-2026, 01:33 PM
RE: Rule 15.1.2 - by misra cpp - 20-02-2026, 12:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)