return Diag(...);
when the function returns bool. This always evaluates to true.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59555
91177308-0d34-0410-b5e6-
96231b3b80d8
const Diagnostic *getDiags() const { return DiagObj; }
unsigned getID() const { return DiagID; }
const FullSourceLoc &getLocation() const { return Loc; }
+
+ /// Operator bool: conversion of DiagnosticInfo to bool always returns true.
+ /// This allows is to be used in boolean error contexts like:
+ /// return Diag(...);
+ operator bool() const { return true; }
unsigned getNumArgs() const { return DiagObj->NumDiagArgs; }