mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 12:51:04 +01:00
Support assigning to a variable through an imported macro (#6827)
Support assigning to a variable through an imported macro
Example:
```carbon
import Cpp inline '''
int v = 1;
#define m v
''';
fn F() {
Cpp.m = 2;
}
```
This commit is contained in:
@@ -2085,8 +2085,7 @@ static auto ImportMacro(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::NameScopeId scope_id, SemIR::NameId name_id,
|
||||
clang::MacroInfo* macro_info)
|
||||
-> SemIR::ScopeLookupResult {
|
||||
auto inst_id =
|
||||
TryEvaluateMacroToConstant(context, loc_id, name_id, macro_info);
|
||||
auto inst_id = TryEvaluateMacro(context, loc_id, name_id, macro_info);
|
||||
if (inst_id == SemIR::ErrorInst::InstId) {
|
||||
return SemIR::ScopeLookupResult::MakeNotFound();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user