llvm/clang/include/clang/Basic/DiagnosticError.h

//===--- DiagnosticError.h - Diagnostic payload for llvm::Error -*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_BASIC_DIAGNOSTICERROR_H
#define LLVM_CLANG_BASIC_DIAGNOSTICERROR_H

#include "clang/Basic/PartialDiagnostic.h"
#include "llvm/Support/Error.h"
#include <optional>

namespace clang {

/// Carries a Clang diagnostic in an llvm::Error.
///
/// Users should emit the stored diagnostic using the DiagnosticsEngine.
class DiagnosticError : public llvm::ErrorInfo<DiagnosticError> {};

} // end namespace clang

#endif // LLVM_CLANG_BASIC_DIAGNOSTICERROR_H