make StringGen clang-compatible
authorPhilip Pronin <philipp@fb.com>
Tue, 20 Aug 2013 10:18:39 +0000 (03:18 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 28 Aug 2013 21:30:12 +0000 (14:30 -0700)
Test Plan:
fbconfig -r folly/test && fbmake opt -j32

Reviewed By: tjackson@fb.com

FB internal diff: D935182

folly/experimental/StringGen-inl.h

index a763dda0ec1a3572149d2f422d83bbbd3d76133d..aa32a29476d27c2d1b5037cfdd4b8e080b90a9da 100644 (file)
@@ -222,6 +222,12 @@ class UnsplitBuffer : public Operator<UnsplitBuffer<Delimiter, OutputBuffer>> {
 template<class Target, class=void>
 inline Target passthrough(Target target) { return target; }
 
+#pragma GCC diagnostic push
+#ifdef __clang__
+// Clang isn't happy with eatField() hack below.
+#pragma GCC diagnostic ignored "-Wreturn-stack-address"
+#endif  // __clang__
+
 /**
  * ParseToTuple - For splitting a record and immediatlely converting it to a
  * target tuple type. Primary used through the 'eachToTuple' helper, like so:
@@ -257,6 +263,8 @@ class SplitTo {
   }
 };
 
+#pragma GCC diagnostic pop
+
 }  // namespace detail
 
 }  // namespace gen