Define CONSTEXPR macro and use it in vec.h.
authorMartin Liska <mliska@suse.cz>
Thu, 18 May 2017 14:22:01 +0000 (16:22 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 18 May 2017 14:22:01 +0000 (14:22 +0000)
2017-05-18  Martin Liska  <mliska@suse.cz>

* ansidecl.h: Define CONSTEXPR macro.
2017-05-18  Martin Liska  <mliska@suse.cz>

* vec.h (struct vnull): Use it.

From-SVN: r248205

gcc/ChangeLog
gcc/vec.h
include/ChangeLog
include/ansidecl.h

index 3ced722..6ae69c3 100644 (file)
@@ -1,3 +1,7 @@
+2017-05-18  Martin Liska  <mliska@suse.cz>
+
+       * vec.h (struct vnull): Use it.
+
 2017-05-18  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-inline-analysis.c (predicate_conditions): Move to ipa-inline.h
index 914f89c..755a1f8 100644 (file)
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -416,10 +416,7 @@ struct GTY((user)) vec
 struct vnull
 {
   template <typename T, typename A, typename L>
-#if __cpp_constexpr >= 200704
-  constexpr
-#endif
-  operator vec<T, A, L> () { return vec<T, A, L>(); }
+  CONSTEXPR operator vec<T, A, L> () { return vec<T, A, L>(); }
 };
 extern vnull vNULL;
 
index 9571a46..9b7a139 100644 (file)
@@ -1,3 +1,7 @@
+2017-05-18  Martin Liska  <mliska@suse.cz>
+
+       * ansidecl.h: Define CONSTEXPR macro.
+
 2017-04-04  Jonathan Wakely  <jwakely@redhat.com>
 
        * ansidecl.h (ATTRIBUTE_PACKED): Fix typo in comment.
index 25f33da..f6e1761 100644 (file)
@@ -313,6 +313,12 @@ So instead we use the macro below and test it against specific values.  */
 #define ENUM_BITFIELD(TYPE) unsigned int
 #endif
 
+#if __cpp_constexpr >= 200704
+#define CONSTEXPR constexpr
+#else
+#define CONSTEXPR
+#endif
+
 /* C++11 adds the ability to add "override" after an implementation of a
    virtual function in a subclass, to:
      (A) document that this is an override of a virtual function