Get the latest tech news

A "Safe C++" Being Explored Using The New ClangIR


An interesting 'request for comments' proposal I have been meaning to write about since last month is in-development work developing 'Safe C++' as an extension to the LLVM Clang compiler and making use of the new, in-development ClangIR.

This isn't the first time there has been a proposal for a "safe" C++ while at the end of November Chuanqi Xu announced this newest initiative to come up with a "Safe C++" based on the ClangIR intermediate representation that would come down to being a pure subset of ISO C++ with a few ignorable pragma and attributes. ClangIR can handle C/C++ higher level semantics for better diagnostics and performance optimizations that are harder to achieve in pure Clang AST or LLVM IR. The thinking is with the ClangIR-based Safe C++ to provide borrow checking, different handling for deprecated calls, deprecating the user of pointers / taking addresses / dereferencing, references within async functions, and other changes to make C++ code safer by better leveraging modern compiler technologies within LLVM/Clang.

Get the Android app

Or read this on Phoronix

Read more on:

Photo of Safe C++

Safe C++

Photo of new clangir

new clangir

Related news:

News photo

Safe C++