From bae992ffd997b25dab752efb1b69388cce33666f Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 9 Feb 2011 08:42:57 +0000 Subject: [PATCH] Non-void functions need to return some value. llvm-svn: 125185 --- clang/lib/AST/Stmt.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index 92af03a5421b..66182957d688 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -91,15 +91,23 @@ namespace { // 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) {} + static inline good is_good(good) { return 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::*) { + return good(); + } + static inline bad implements_children(children_t Stmt::*) { + return bad(); + } 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::*) { + return good(); + } + static inline bad implements_getSourceRange(getSourceRange_t Stmt::*) { + return bad(); + } #define ASSERT_IMPLEMENTS_children(type) \ (void) sizeof(is_good(implements_children(&type::children)))