Add SAT check when entering an #if/#ifdef
Opened this issue · 2 comments
mayshukla commented
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
mayshukla commented
Also, issue a diagnostic saying that there is unreachable code. If this diagnostic could be enabled/disabled optionally that would be ideal.
mayshukla commented
This should be done in the preprocessor