Files
clang-p2996/clang/test/CodeGen
Anders Waldenborg dd2362a8ba [clang] Allow const variables with weak attribute to be overridden
A variable with `weak` attribute signifies that it can be replaced with
a "strong" symbol link time. Therefore it must not emitted with
"weak_odr" linkage, as that allows the backend to use its value in
optimizations.

The frontend already considers weak const variables as
non-constant (note_constexpr_var_init_weak diagnostic) so this change
makes frontend and backend consistent.

This commit reverses the
  f49573d1 weak globals that are const should get weak_odr linkage.
commit from 2009-08-05 which introduced this behavior. Unfortunately
that commit doesn't provide any details on why the change was made.

This was discussed in
https://discourse.llvm.org/t/weak-attribute-semantics-on-const-variables/62311

Differential Revision: https://reviews.llvm.org/D126324
2022-06-03 23:44:15 +02:00
..
2011-07-26 21:42:32 +00:00
2022-04-04 11:32:05 -04:00
2015-01-24 17:39:36 +00:00
2018-02-23 19:30:48 +00:00
2010-09-23 09:40:31 +00:00
2021-03-24 18:11:37 -07:00
2011-05-04 18:51:37 +00:00
2018-02-23 19:30:48 +00:00
2013-01-24 23:34:51 +00:00
2013-07-03 01:43:57 +00:00
2020-12-08 10:28:26 +00:00
2021-05-15 10:22:49 -07:00
2021-10-15 16:23:04 +00:00