Imported Upstream version 20161101 58/98958/1 upstream/20161101
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 21 Nov 2016 08:00:05 +0000 (17:00 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 21 Nov 2016 08:00:06 +0000 (17:00 +0900)
Change-Id: I4a69bc9e967d2c8f8374676316d4be5d8c050436
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
BUILD
re2/dfa.cc

diff --git a/BUILD b/BUILD
index f4abb0a..5223f6e 100644 (file)
--- a/BUILD
+++ b/BUILD
@@ -89,6 +89,7 @@ cc_library(
 
 cc_library(
     name = "test",
+    testonly = 1,
     srcs = ["util/test.cc"],
     deps = [":testing"],
 )
@@ -155,12 +156,14 @@ re2_test(
 
 cc_library(
     name = "benchmark",
+    testonly = 1,
     srcs = ["util/benchmark.cc"],
     deps = [":testing"],
 )
 
 cc_binary(
     name = "regexp_benchmark",
+    testonly = 1,
     srcs = ["re2/testing/regexp_benchmark.cc"],
     linkopts = [
         "-lm",
index 1fc8a5a..417efc1 100644 (file)
@@ -123,7 +123,15 @@ class DFA {
     uint32_t flag_;     // Empty string bitfield flags in effect on the way
                         // into this state, along with kFlagMatch if this
                         // is a matching state.
+
+// Work around the bug affecting flexible array members in GCC 6.1 and 6.2.
+// (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70932)
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 6 && __GNUC_MINOR__ >= 1
+    std::atomic<State*> next_[0];   // Outgoing arrows from State,
+#else
     std::atomic<State*> next_[];    // Outgoing arrows from State,
+#endif
+
                         // one per input byte class
   };