diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -492,6 +492,8 @@ (`See patch `_). - Fix crash when passing a value larger then 64 bits to the aligned attribute. (`#50534 `_). +- Fix lambdas in template arguments ``-fmacro-prefix-map`` + (`#63219 `_) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -786,7 +786,21 @@ Out << "static "; } + class PrettyCallbacks final : public PrintingCallbacks { + public: + PrettyCallbacks(const LangOptions &L) : LO(L) {} + std::string remapPath(StringRef Path) const override { + SmallString<128> p(Path); + LO.remapPathPrefix(p); + return std::string(p); + } + + private: + const LangOptions &LO; + }; PrintingPolicy Policy(Context.getLangOpts()); + PrettyCallbacks PrettyCB(Context.getLangOpts()); + Policy.Callbacks = &PrettyCB; std::string Proto; llvm::raw_string_ostream POut(Proto);