class DiagnosticErrorTrap

Declaration

class DiagnosticErrorTrap { /* full declaration omitted */ };

Description

RAII class that determines when any errors have occurred between the time the instance was created and the time it was queried. Note that you almost certainly do not want to use this. It's usually meaningless to ask whether a particular scope triggered an error message, because error messages outside that scope can mark things invalid (or cause us to reach an error limit), which can suppress errors within that scope.

Declared at: clang/include/clang/Basic/Diagnostic.h:1072

Member Variables

private clang::DiagnosticsEngine& Diag
private unsigned int NumErrors
private unsigned int NumUnrecoverableErrors

Method Overview

Methods

DiagnosticErrorTrap(
    clang::DiagnosticsEngine& Diag)

Declared at: clang/include/clang/Basic/Diagnostic.h:1078

Parameters

clang::DiagnosticsEngine& Diag

bool hasErrorOccurred() const

Description

Determine whether any errors have occurred since this object instance was created.

Declared at: clang/include/clang/Basic/Diagnostic.h:1083

bool hasUnrecoverableErrorOccurred() const

Description

Determine whether any unrecoverable errors have occurred since this object instance was created.

Declared at: clang/include/clang/Basic/Diagnostic.h:1089

void reset()

Description

Set to initial state of "no errors occurred".

Declared at: clang/include/clang/Basic/Diagnostic.h:1094