mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 09:30:11 +01:00
This was failing to build for me locally with some arbitrary Clang HEAD
host compiler:
```
migrate_cpp/rewriter.cpp:225:3: error: call to member function 'SetReplacement' is ambiguous
225 | SetReplacement(expr, {OutputSegment(std::move(text))});
| ^~~~~~~~~~~~~~
./migrate_cpp/rewriter.h:141:8: note: candidate function [with T = clang::IntegerLiteral]
141 | auto SetReplacement(const T* node, std::vector<OutputSegment> output_segments)
| ^
./migrate_cpp/rewriter.h:150:8: note: candidate function [with T = clang::IntegerLiteral]
150 | auto SetReplacement(const T* node, OutputSegment segment) -> void {
| ^
```
No idea if that's a bug in clang HEAD, but it seemed like removing the
{} simplified the code anyway - so here's that.
C++ migration tooling
Table of contents
Overview
migrate_cpp assists in migration of C++ code to Carbon. It's currently being
assembled; more documentation will be added later.
Structure
The migrate_cpp tool uses a clang::RecursiveASTVisitor to traverse Clang's
AST and, to each node, associate replacements. Each node's replacement is a
sequence of text, or a reference to some other node that should be used to
replace it.