Issue 142614
Summary [Clang] Different `-Wunused-value` output in preprocessed source code
Labels clang
Assignees
Reporter iii-i
    Clang reports `-Wunused-value` for the following code:

```
int f(void);
void g(void) { (long)f(); }
```

but not the following:

```
int f(void);
#define MACRO() (long)f()
void g(void) { MACRO(); }
```

This is because `DiagnoseUnused()` calls `S.SourceMgr.isMacroBodyExpansion()`.
This is problematic when one tries to work with preprocessed source code, for example, using `icecc` to build it on a remote machine.
Is there a way to preserve macro expansion information, in order to make `isMacroBodyExpansion()` return identical values for both preprocessed and non-preprocessed source code?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to