@@ -7103,28 +7103,55 @@ inline const Type *Type::getPointeeOrArrayElementType() const {
71037103 return type->getBaseElementTypeUnsafe ();
71047104 return type;
71057105}
7106+ // / Insertion operator for diagnostics. This allows sending address spaces into
7107+ // / a diagnostic with <<.
7108+ inline const DiagnosticBuilder &operator <<(const DiagnosticBuilder &DB,
7109+ LangAS AS) {
7110+ DB.AddTaggedVal (static_cast <std::underlying_type_t <LangAS>>(AS),
7111+ DiagnosticsEngine::ArgumentKind::ak_addrspace);
7112+ return DB;
7113+ }
7114+
71067115// / Insertion operator for partial diagnostics. This allows sending adress
71077116// / spaces into a diagnostic with <<.
7108- inline const StreamableDiagnosticBase &
7109- operator <<( const StreamableDiagnosticBase &PD, LangAS AS) {
7117+ inline const PartialDiagnostic & operator <<( const PartialDiagnostic &PD,
7118+ LangAS AS) {
71107119 PD.AddTaggedVal (static_cast <std::underlying_type_t <LangAS>>(AS),
71117120 DiagnosticsEngine::ArgumentKind::ak_addrspace);
71127121 return PD;
71137122}
71147123
7124+ // / Insertion operator for diagnostics. This allows sending Qualifiers into a
7125+ // / diagnostic with <<.
7126+ inline const DiagnosticBuilder &operator <<(const DiagnosticBuilder &DB,
7127+ Qualifiers Q) {
7128+ DB.AddTaggedVal (Q.getAsOpaqueValue (),
7129+ DiagnosticsEngine::ArgumentKind::ak_qual);
7130+ return DB;
7131+ }
7132+
71157133// / Insertion operator for partial diagnostics. This allows sending Qualifiers
71167134// / into a diagnostic with <<.
7117- inline const StreamableDiagnosticBase &
7118- operator <<( const StreamableDiagnosticBase &PD, Qualifiers Q) {
7135+ inline const PartialDiagnostic & operator <<( const PartialDiagnostic &PD,
7136+ Qualifiers Q) {
71197137 PD.AddTaggedVal (Q.getAsOpaqueValue (),
71207138 DiagnosticsEngine::ArgumentKind::ak_qual);
71217139 return PD;
71227140}
71237141
7142+ // / Insertion operator for diagnostics. This allows sending QualType's into a
7143+ // / diagnostic with <<.
7144+ inline const DiagnosticBuilder &operator <<(const DiagnosticBuilder &DB,
7145+ QualType T) {
7146+ DB.AddTaggedVal (reinterpret_cast <intptr_t >(T.getAsOpaquePtr ()),
7147+ DiagnosticsEngine::ak_qualtype);
7148+ return DB;
7149+ }
7150+
71247151// / Insertion operator for partial diagnostics. This allows sending QualType's
71257152// / into a diagnostic with <<.
7126- inline const StreamableDiagnosticBase &
7127- operator <<( const StreamableDiagnosticBase &PD, QualType T) {
7153+ inline const PartialDiagnostic & operator <<( const PartialDiagnostic &PD,
7154+ QualType T) {
71287155 PD.AddTaggedVal (reinterpret_cast <intptr_t >(T.getAsOpaquePtr ()),
71297156 DiagnosticsEngine::ak_qualtype);
71307157 return PD;
0 commit comments