[clang] [clang][ASTImporter] Add import of node 'FileScopeAsmDecl' (PR #193244)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue May 5 02:38:12 PDT 2026


================
@@ -2781,6 +2782,27 @@ ExpectedDecl ASTNodeImporter::VisitTranslationUnitDecl(TranslationUnitDecl *D) {
   return ToD;
 }
 
+ExpectedDecl ASTNodeImporter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
+  Error Err = Error::success();
+  Expr *ToAsmString = importChecked(Err, D->getAsmStringExpr());
+  SourceLocation ToAsmLoc = importChecked(Err, D->getAsmLoc());
+  SourceLocation ToRParenLoc = importChecked(Err, D->getRParenLoc());
----------------
NagyDonat wrote:

```suggestion
  SourceLocation ToRParenLoc = importChecked(Err, D->getRParenLoc());
  if (Err)
    return std::move(Err);
```
Following the example of other nearby functions, you probably need to return the error at this point.

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


More information about the cfe-commits mailing list