diff mbox

Add const to constexpr member functions

Message ID 20140415182910.GO6807@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely April 15, 2014, 6:29 p.m. UTC
Add const to functions that would change meaning in C++14.

Tested x86_64-linux, committed to trunk.
commit f30d35d5a7aa3ff2e0d0e4010aecaf9f5a5fb9ed
Author: Jonathan Wakely <accu@kayari.org>
Date:   Tue Apr 15 18:55:45 2014 +0100

    	* include/bits/atomic_base.h (__atomic_base<_PTp*>::_M_type_size): Add
    	const to constexpr member functions.

Comments

Jonathan Wakely Aug. 4, 2014, 7:12 p.m. UTC | #1
On 15/04/14 19:29 +0100, Jonathan Wakely wrote:
>Add const to functions that would change meaning in C++14.
>
>Tested x86_64-linux, committed to trunk.

Also committed to the 4.9 branch

>    	* include/bits/atomic_base.h (__atomic_base<_PTp*>::_M_type_size): Add
>    	const to constexpr member functions.
diff mbox

Patch

diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h
index 242459a..1fc0ebb 100644
--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -675,10 +675,10 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       // Factored out to facilitate explicit specialization.
       constexpr ptrdiff_t
-      _M_type_size(ptrdiff_t __d) { return __d * sizeof(_PTp); }
+      _M_type_size(ptrdiff_t __d) const { return __d * sizeof(_PTp); }
 
       constexpr ptrdiff_t
-      _M_type_size(ptrdiff_t __d) volatile { return __d * sizeof(_PTp); }
+      _M_type_size(ptrdiff_t __d) const volatile { return __d * sizeof(_PTp); }
 
     public:
       __atomic_base() noexcept = default;