[cfe-commits] r125184 - /cfe/trunk/lib/AST/Stmt.cpp

John McCall rjmccall at apple.com
Wed Feb 9 00:31:17 PST 2011


Author: rjmccall
Date: Wed Feb  9 02:31:17 2011
New Revision: 125184

URL: http://llvm.org/viewvc/llvm-project?rev=125184&view=rev
Log:
Give these little helper functions definitions so that newer gccs stop
complaining.


Modified:
    cfe/trunk/lib/AST/Stmt.cpp

Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=125184&r1=125183&r2=125184&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Wed Feb  9 02:31:17 2011
@@ -87,15 +87,19 @@
 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 <class T> good implements_children(children_t T::*);
-  static inline bad implements_children(children_t Stmt::*);
+  template <class T> good implements_children(children_t T::*) {}
+  static inline bad implements_children(children_t Stmt::*) {}
 
   typedef SourceRange getSourceRange_t() const;
-  template <class T> good implements_getSourceRange(getSourceRange_t T::*);
-  static inline bad implements_getSourceRange(getSourceRange_t Stmt::*);
+  template <class T> 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)))





More information about the cfe-commits mailing list