]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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 3ced7226cc9a7e3f391b1a228b7c9b3c95d30ad9..6ae69c3fe9d809ac967999ee1eca4a6deabf74bb 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 914f89c350c87d95acda70cb2a8475b50929035d..755a1f8356bc1b24c0e9c282ab63a6304f7881f3 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 9571a46a1efcf225b3068ff5845c5349cdd010df..9b7a139bc26f85fd85d884be9069a35dea8be531 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 25f33dad232e86490d1644c9cf5f29323d224ce3..f6e1761af2d0a2d788ff5f2d8007136f23b21dea 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