From: John McCall Date: Wed, 9 Feb 2011 08:31:17 +0000 (+0000) Subject: Give these little helper functions definitions so that newer gccs stop X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8c7fdbfc6854a11f0823dd11514af5a8d759aff;p=clang Give these little helper functions definitions so that newer gccs stop complaining. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125184 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index b4abd05d68..92af03a542 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -87,15 +87,19 @@ bool Stmt::CollectingStats(bool Enable) { namespace { struct good {}; struct bad {}; - static inline good is_good(good); // static inline to suppress unused warning + + // These silly little functions have to be static inline to suppress + // unused warnings, and they have to be defined to suppress other + // warnings. + static inline good is_good(good) {} typedef Stmt::child_range children_t(); - template good implements_children(children_t T::*); - static inline bad implements_children(children_t Stmt::*); + template good implements_children(children_t T::*) {} + static inline bad implements_children(children_t Stmt::*) {} typedef SourceRange getSourceRange_t() const; - template good implements_getSourceRange(getSourceRange_t T::*); - static inline bad implements_getSourceRange(getSourceRange_t Stmt::*); + template good implements_getSourceRange(getSourceRange_t T::*) {} + static inline bad implements_getSourceRange(getSourceRange_t Stmt::*) {} #define ASSERT_IMPLEMENTS_children(type) \ (void) sizeof(is_good(implements_children(&type::children)))