r273144 - in /trunk/libstdc++-v3: ChangeLog inc...

redi@gcc.gnu.org redi@gcc.gnu.org
Fri Jul 5 16:10:00 GMT 2019


Author: redi
Date: Fri Jul  5 16:10:47 2019
New Revision: 273144

URL: https://gcc.gnu.org/viewcvs?rev=273144&root=gcc&view=rev
Log:
Fix ODR violations in code using <ext/atomicity.h>

Because the inline versions of __exchange_and_add and __atomic_add are
also marked static, they cannot be used from templates or other inline
functions without ODR violations. This change gives them external
linkage, but adds the always_inline attribute.

    	* include/ext/atomicity.h [_GLIBCXX_ATOMIC_BUILTINS] (__atomic_add)
    	(__exchange_and_add): Replace static specifier with always_inline
    	attribute.
    	(__exchange_and_add_single, __atomic_add_single): Likewise.
    	(__exchange_and_add_dispatch, __atomic_add_dispatch): Likewise. Also
    	combine !__gthread_active_p() and !__GTHREADS branches.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/ext/atomicity.h



More information about the Libstdc++-cvs mailing list