title: Problems with ifdef based inheritance in C++
body: <p>I was looking at the code of some class I was using, and I came across code like this:</p>
  
  <pre><code>#ifdef SOME_OBSCURE_CONDITION
  class A {
  #elif 
  class A : public B {
  #endif
  </code></pre>
  
  <p>Can there be any problems with such code? </p>
  
  <p>Specifically, suppose file x.cpp includes y.h and z.h.
  z.h and y.h both include a.h (which defines class A), but additionally y.h defines SOME_OBSCURE_CONDITION. In this case, will two conflicting definitions of A not be present in x.cpp?</p>