From 6496bd10dc3a6d5e3266348f08b6e35f8184bc99 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 5 Feb 2012 09:46:30 +0000 Subject: [PATCH] Move operator overload out of line. Calling operator<< on a forward declared type doesn't seem to work on MSVC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149819 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/CanonicalType.h | 7 +------ lib/AST/Type.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/clang/AST/CanonicalType.h b/include/clang/AST/CanonicalType.h index 99552b3617..5b27b4e1fa 100644 --- a/include/clang/AST/CanonicalType.h +++ b/include/clang/AST/CanonicalType.h @@ -16,7 +16,6 @@ #define LLVM_CLANG_AST_CANONICAL_TYPE_H #include "clang/AST/Type.h" -#include "clang/Basic/Diagnostic.h" #include "llvm/Support/Casting.h" #include "llvm/Support/type_traits.h" #include @@ -201,11 +200,7 @@ inline CanQualType Type::getCanonicalTypeUnqualified() const { return CanQualType::CreateUnsafe(getCanonicalTypeInternal()); } -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - CanQualType T) { - DB << static_cast(T); - return DB; -} +const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, CanQualType T); //----------------------------------------------------------------------------// // Internal proxy classes used by canonical types diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 1c5aa3194e..be38ba66bc 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -2324,3 +2324,9 @@ const PartialDiagnostic &clang::operator<<(const PartialDiagnostic &PD, DiagnosticsEngine::ak_qualtype); return PD; } + +const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB, + CanQualType T) { + DB << static_cast(T); + return DB; +} -- 2.40.0