[clang] [clang-tools-extra] [llvm] [clang] Introduce diagnostics suppression mappings (PR #112517)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 07:25:39 PST 2024


Michael137 wrote:

Hmm this one's a bit strange. Looks like the issue is in:
```
// Clang-diagnostics pragmas always take precedence over suppression mapping.
if (!Mapping.isPragma()) {                                                   
  // We also use presumed locations here to improve reproducibility for      
  // preprocessed inputs.                                                    
  if (PresumedLoc PLoc = SM.getPresumedLoc(Loc);                             
      PLoc.isValid() && Diag.isSuppressedViaMapping(                         
                            DiagID, llvm::sys::path::remove_leading_dotslash(
                                        PLoc.getFilename())))                
    return diag::Severity::Ignored;                                          
}                                                                            
```
The assert triggers inside `getPresumedLoc`. So doesn't look like it's an inherent issue with the patch. But it seems to be breaking assumptions that LLDB is making about these source locations

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


More information about the cfe-commits mailing list