[clang] [clang][dataflow] Emit an error if source code is not compiled as C++. (PR #65301)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 00:00:31 PST 2023


martinboehme wrote:

> Is this the right place to add this check? It doesn't seem like there's any C++-specific logic here.
> 
> Presumably the real incompatibility is `clang::CFG` or one of the consumers of `dataflow::ControlFlowContext`?

Much of the logic in the dataflow framework assumes that the AST comes from a C++ compilation. For example, the code in Transfer.cpp makes a lot of assumptions around this, but other places do too.

`ControlFlowContext::build()` is a good central place to check whether the language is C++ and abort with a meaningful error message if it isn't.



https://github.com/llvm/llvm-project/pull/65301


More information about the cfe-commits mailing list