The compiler does not detect a multiple-definition error, since c.cc and d.cc are separate translation units. They are processed separately from each other; each has exactly one definition of the Dummy::Dummy constructor.
The connector does not detect a multiple definition error, because the definition of the Dummy::Dummy constructor from the header is treated as an inline definition. The language allows a built-in definition in each translation unit, if they are all identical. Typically, the reason these definitions are identical is because they are all taken from the same header file, but the standard requires that the definitions be identical, even if they come from different files.
When your program violates this rule, its behavior is undefined. This is why your program behaves differently depending on the seemingly unrelated act of changing the order of translation units during the translation.
dasblinkenlight
source share