ualberta-smr/varclang

Add SAT check when entering an #if/#ifdef

Opened this issue · 2 comments

The parser (maybe the preprocessor?) should check for unreachable blocks. These would have unsatisfiable presence conditions. Then, the parser will not create redundant declarations.

For example:

#ifdef A
  #ifndef A
    int i = 0; // unreachable
  #endif
#endif

Also, issue a diagnostic saying that there is unreachable code. If this diagnostic could be enabled/disabled optionally that would be ideal.

This should be done in the preprocessor