[clang] [clang][Sema] Bad register variable type error should point to the type (PR #110239)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 1 16:45:21 PDT 2024


================
@@ -7949,7 +7949,8 @@ NamedDecl *Sema::ActOnVariableDeclarator(
       }
 
       if (!R->isIntegralType(Context) && !R->isPointerType()) {
-        Diag(D.getBeginLoc(), diag::err_asm_bad_register_type);
+        Diag(TInfo->getTypeLoc().getBeginLoc(),
+             diag::err_asm_bad_register_type);
----------------
Sirraide wrote:

Maybe also add `<< TInfo->getTypeLoc().getSourceRange()`

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


More information about the cfe-commits mailing list