clang 20.0.0git
Public Member Functions | Friends | List of all members
clang::SemaBase::ImmediateDiagBuilder Class Reference

Helper class that creates diagnostics with optional template instantiation stacks. More...

#include "clang/Sema/SemaBase.h"

Inheritance diagram for clang::SemaBase::ImmediateDiagBuilder:
Inheritance graph
[legend]

Public Member Functions

 ImmediateDiagBuilder (DiagnosticBuilder &DB, Sema &SemaRef, unsigned DiagID)
 
 ImmediateDiagBuilder (DiagnosticBuilder &&DB, Sema &SemaRef, unsigned DiagID)
 
 ImmediateDiagBuilder (const ImmediateDiagBuilder &)=default
 
 ~ImmediateDiagBuilder ()
 
template<typename T , typename = std::enable_if_t<!std::is_lvalue_reference<T>::value>>
const ImmediateDiagBuilderoperator<< (T &&V) const
 
- Public Member Functions inherited from clang::DiagnosticBuilder
 DiagnosticBuilder (const DiagnosticBuilder &D)
 Copy constructor.
 
template<typename T >
const DiagnosticBuilderoperator<< (const T &V) const
 
template<typename T , typename = std::enable_if_t<!std::is_lvalue_reference<T>::value>>
const DiagnosticBuilderoperator<< (T &&V) const
 
DiagnosticBuilderoperator= (const DiagnosticBuilder &)=delete
 
 ~DiagnosticBuilder ()
 Emits the diagnostic.
 
const DiagnosticBuildersetForceEmit () const
 Forces the diagnostic to be emitted.
 
void addFlagValue (StringRef V) const
 
- Public Member Functions inherited from clang::StreamingDiagnostic
DiagnosticStoragegetStorage () const
 Retrieve storage for this particular diagnostic.
 
void freeStorage ()
 
void freeStorageSlow ()
 
void AddTaggedVal (uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
 
void AddString (StringRef V) const
 
void AddSourceRange (const CharSourceRange &R) const
 
void AddFixItHint (const FixItHint &Hint) const
 
 operator bool () const
 Conversion of StreamingDiagnostic to bool always returns true.
 

Friends

template<typename T >
const ImmediateDiagBuilderoperator<< (const ImmediateDiagBuilder &Diag, const T &Value)
 Teach operator<< to produce an object of the correct type.
 

Additional Inherited Members

- Protected Member Functions inherited from clang::DiagnosticBuilder
void Clear () const
 Clear out the current diagnostic.
 
bool isActive () const
 Determine whether this diagnostic is still active.
 
bool Emit ()
 Force the diagnostic builder to emit the diagnostic now.
 
- Protected Member Functions inherited from clang::StreamingDiagnostic
 StreamingDiagnostic ()=default
 
 StreamingDiagnostic (DiagnosticStorage *Storage)
 Construct with an external storage not owned by itself.
 
 StreamingDiagnostic (DiagStorageAllocator &Alloc)
 Construct with a storage allocator which will manage the storage.
 
 StreamingDiagnostic (const StreamingDiagnostic &Diag)=default
 
 StreamingDiagnostic (StreamingDiagnostic &&Diag)=default
 
 ~StreamingDiagnostic ()
 
- Protected Attributes inherited from clang::StreamingDiagnostic
DiagnosticStorageDiagStorage = nullptr
 
DiagStorageAllocatorAllocator = nullptr
 Allocator used to allocate storage for this diagnostic.
 

Detailed Description

Helper class that creates diagnostics with optional template instantiation stacks.

This class provides a wrapper around the basic DiagnosticBuilder class that emits diagnostics. ImmediateDiagBuilder is responsible for emitting the diagnostic (as DiagnosticBuilder does) and, if the diagnostic comes from inside a template instantiation, printing the template instantiation stack as well.

Definition at line 55 of file SemaBase.h.

Constructor & Destructor Documentation

◆ ImmediateDiagBuilder() [1/3]

clang::SemaBase::ImmediateDiagBuilder::ImmediateDiagBuilder ( DiagnosticBuilder DB,
Sema SemaRef,
unsigned  DiagID 
)
inline

Definition at line 60 of file SemaBase.h.

◆ ImmediateDiagBuilder() [2/3]

clang::SemaBase::ImmediateDiagBuilder::ImmediateDiagBuilder ( DiagnosticBuilder &&  DB,
Sema SemaRef,
unsigned  DiagID 
)
inline

Definition at line 62 of file SemaBase.h.

◆ ImmediateDiagBuilder() [3/3]

clang::SemaBase::ImmediateDiagBuilder::ImmediateDiagBuilder ( const ImmediateDiagBuilder )
default

◆ ~ImmediateDiagBuilder()

clang::SemaBase::ImmediateDiagBuilder::~ImmediateDiagBuilder ( )

Member Function Documentation

◆ operator<<()

template<typename T , typename = std::enable_if_t<!std::is_lvalue_reference<T>::value>>
const ImmediateDiagBuilder & clang::SemaBase::ImmediateDiagBuilder::operator<< ( T &&  V) const
inline

Definition at line 89 of file SemaBase.h.

References V.

Friends And Related Function Documentation

◆ operator<<

template<typename T >
const ImmediateDiagBuilder & operator<< ( const ImmediateDiagBuilder Diag,
const T Value 
)
friend

Teach operator<< to produce an object of the correct type.

Definition at line 77 of file SemaBase.h.


The documentation for this class was generated from the following files: