8sa1-gcc/gcc/testsuite/g++.dg/cpp1z
Jason Merrill 8685348075 c++: C++17 constexpr static data member linkage [PR99901]
C++17 makes constexpr static data members implicitly inline variables.  In
C++14, a subsequent out-of-class declaration is the definition.  We want to
continue emitting a symbol for such a declaration in C++17 mode, for ABI
compatibility with C++14 code that wants to refer to it.

Normally I'd distinguish in- and out-of-class declarations by looking at
DECL_IN_AGGR_P, but we never set DECL_IN_AGGR_P on inline variables.  I
think that's wrong, but don't want to mess with it so close to release.
Conveniently, we already have a test for in-class declaration earlier in the
function.

gcc/cp/ChangeLog:

	PR c++/99901
	* decl.c (cp_finish_decl): mark_needed an implicitly inline
	static data member with an out-of-class redeclaration.

gcc/testsuite/ChangeLog:

	PR c++/99901
	* g++.dg/cpp1z/inline-var9.C: New test.
2021-04-06 14:30:02 -04:00
..
aggr-base1.C
aggr-base1a.C
aggr-base2.C
aggr-base2a.C
aggr-base3.C
aggr-base4.C
aggr-base5.C
aggr-base6.C
aggr-base7.C
aggr-base8.C
aggr-base9.C
aggr-base10.C
aligned-new1.C
aligned-new2.C
aligned-new3.C
aligned-new4.C
aligned-new4a.C
aligned-new5.C
aligned-new6.C
aligned-new7.C
aligned-new8.C
attr-lambda1.C
attributes-enum-1.C
attributes-enum-1a.C
auto1.C c++: Some preparatory type canonicalization fixes 2021-03-02 07:38:37 -05:00
bool-increment1.C
byte1.C
byte2.C
class-deduction1.C
class-deduction2.C
class-deduction3.C
class-deduction4.C
class-deduction5.C
class-deduction6.C
class-deduction7.C
class-deduction8.C
class-deduction9.C
class-deduction10.C
class-deduction11.C
class-deduction12.C
class-deduction13.C
class-deduction14.C
class-deduction15.C
class-deduction16.C
class-deduction17.C
class-deduction18.C
class-deduction19.C
class-deduction20.C
class-deduction21.C
class-deduction22.C
class-deduction23.C
class-deduction24.C
class-deduction25.C
class-deduction26.C
class-deduction27.C
class-deduction28.C
class-deduction29.C
class-deduction30.C
class-deduction31.C
class-deduction32.C
class-deduction33.C
class-deduction34.C
class-deduction35.C
class-deduction36.C
class-deduction38.C
class-deduction39.C
class-deduction40.C
class-deduction41.C
class-deduction42.C
class-deduction43.C
class-deduction44.C c++: EOF location [PR 96045] 2020-12-23 14:26:50 -08:00
class-deduction45.C
class-deduction46.C
class-deduction47.C
class-deduction48.C
class-deduction49.C
class-deduction50.C
class-deduction51.C
class-deduction52.C
class-deduction53.C
class-deduction54.C
class-deduction55.C
class-deduction56.C
class-deduction57.C
class-deduction58.C
class-deduction59.C
class-deduction60.C
class-deduction61.C
class-deduction62.C
class-deduction63.C
class-deduction64.C
class-deduction65.C
class-deduction66.C
class-deduction67.C
class-deduction68.C
class-deduction69.C c++: Implement C++20 'using enum'. [PR91367] 2020-11-13 13:36:29 -05:00
class-deduction70.C
class-deduction71.C
class-deduction72.C
class-deduction73.C c++: CTAD and explicit deduction guides for copy-list-init [PR90210] 2020-09-30 20:56:42 -04:00
class-deduction74.C c++: Detect deduction guide redeclaration [PR97099] 2020-09-21 10:11:41 -04:00
class-deduction75.C c++: Don't try to parse a function declaration as deduction guide [PR97663] 2020-11-03 21:42:51 +01:00
class-deduction76.C c++: ICE with deferred noexcept when deducing targs [PR82099] 2021-01-05 11:06:41 -05:00
class-deduction77.C c++: Add CTAD + pack expansion testcase 2021-01-18 16:41:46 -05:00
class-deduction78.C c++: No aggregate CTAD with explicit dguide [PR98802] 2021-02-03 22:03:40 -05:00
class-deduction79.C c++: Fix CTAD of single-element initializer list [PR99103] 2021-02-25 16:38:08 -05:00
class-deduction80.C c++: Fix CTAD of single-element initializer list [PR99103] 2021-02-25 16:38:08 -05:00
class-deduction81.C c++: ICE with deduction guide in checking type-dep [PR99009, PR97034] 2021-03-03 09:52:37 -05:00
class-deduction82.C c++: ICE with deduction guide in checking type-dep [PR99009, PR97034] 2021-03-03 09:52:37 -05:00
class-deduction83.C c++: Add fixed test [PR96474] 2021-03-03 15:12:07 -05:00
class-deduction-decltype1.C c++: Member fns and deduction guide rewriting [PR98929] 2021-02-02 12:11:39 -05:00
class-deduction-spec1.C
constexpr-83692.C
constexpr-84684.C
constexpr-96575.C c++: constexpr evaluation and bare EMPTY_CLASS_EXPR [PR96575] 2020-10-22 07:33:58 -04:00
constexpr-96862.C c++: Disable -frounding-math during manifestly constant evaluation [PR96862] 2020-09-03 20:11:43 +02:00
constexpr-array1.C
constexpr-if1.C
constexpr-if2.C
constexpr-if3.C
constexpr-if4.C
constexpr-if5.C
constexpr-if6.C
constexpr-if7.C
constexpr-if8.C
constexpr-if9.C
constexpr-if10.C
constexpr-if11.C
constexpr-if12.C
constexpr-if13.C
constexpr-if14.C
constexpr-if15.C
constexpr-if16.C
constexpr-if17.C
constexpr-if18.C
constexpr-if19.C
constexpr-if20.C
constexpr-if21.C
constexpr-if22.C
constexpr-if23.C
constexpr-if24.C
constexpr-if25.C
constexpr-if26.C
constexpr-if27.C
constexpr-if28.C
constexpr-if29.C
constexpr-if30.C
constexpr-if31.C
constexpr-if32.C
constexpr-if33.C
constexpr-if34.C
constexpr-if-lambda1.C
constexpr-if-lambda2.C
constexpr-if-lambda3.C
constexpr-if-lambda4.C c++: constexpr if and nested generic lambda [PR99201] 2021-04-05 08:25:52 -04:00
constexpr-lambda1.C
constexpr-lambda2.C
constexpr-lambda3.C
constexpr-lambda4.C
constexpr-lambda5.C
constexpr-lambda6.C
constexpr-lambda7.C
constexpr-lambda8.C
constexpr-lambda9.C
constexpr-lambda10.C
constexpr-lambda11.C
constexpr-lambda12.C
constexpr-lambda13.C
constexpr-lambda14.C
constexpr-lambda15.C
constexpr-lambda16.C
constexpr-lambda17.C
constexpr-lambda18.C
constexpr-lambda19.C
constexpr-lambda20.C
constexpr-lambda21.C
constexpr-lambda22.C
constexpr-lambda23.C
constexpr-lambda24.C
constexpr-lambda25.C
constexpr-lambda26.C c++: Add 5 unfixed tests. 2020-11-10 15:02:51 -05:00
constexpr-tracking-const1.C
conv-tmpl1.C
cplusplus_1z.C
cplusplus.C
decomp1.C
decomp2.C
decomp3.C
decomp4.C
decomp5.C
decomp6.C
decomp7.C
decomp8.C
decomp9.C
decomp10.C
decomp11.C
decomp12.C
decomp13.C
decomp14.C
decomp15.C
decomp16.C
decomp17.C
decomp18.C
decomp19.C
decomp20.C
decomp21.C
decomp22.C
decomp23.C
decomp24.C
decomp25.C
decomp26.C
decomp27.C
decomp28.C
decomp29.C
decomp30.C
decomp31.C
decomp32.C
decomp33.C
decomp34.C
decomp35.C
decomp36.C
decomp37.C
decomp38.C
decomp39.C
decomp40.C
decomp41.C
decomp42.C
decomp43.C
decomp44.C
decomp45.C
decomp46.C
decomp47.C
decomp48.C
decomp49.C
decomp50.C
decomp51.C
decomp52.C
decomp53.C
decomp54.C c++: Fix ICE with structured binding initialized to incomplete array [PR97878] 2021-02-05 10:22:07 +01:00
decomp55.C c++: Diagnose references to void in structured bindings [PR99650] 2021-03-23 10:23:42 +01:00
decomp-bitfield1.C
decomp-constexpr1.C
decomp-lambda1.C
direct-enum-init1.C
dr393.C
elide1.C
elide2.C
elide3.C
elide4.C c++: Fix copy elision for base initialization 2021-01-15 13:57:01 -05:00
elide5.C c++: Avoid redundant copy in {} init [PR98642] 2021-01-15 13:57:01 -05:00
eval-order2.C
eval-order3.C
eval-order4.C
eval-order5.C
eval-order6.C
eval-order7.C
eval-order8.C
eval-order9.C
eval-order10.C c++: Fix -fstrong-eval-order for operator &&, || and , [PR82959] 2021-03-03 16:12:23 +01:00
fallthrough1.C
feat-cxx1z.C
fold1.C
fold2.C
fold3.C
fold4.C
fold5.C
fold6.C
fold7.C
fold7a.C
fold8.C
fold9.C
fold10.C
fold11.C
fold12.C c++: GCC accepts junk before fold-expression [PR86773] 2020-10-28 15:22:05 -04:00
fold-ice1.C
fold-lambda2.C
fold-lambda3.C
fold-lambda.C
fold-mangle.C
gen-attrs1.C
has-unique-obj-representations1.C
has-unique-obj-representations2.C
inh-ctor1.C
inh-ctor22.C
inh-ctor23.C
inh-ctor24.C
inh-ctor25.C
inh-ctor26.C
inh-ctor27.C
inh-ctor28.C
inh-ctor29.C
inh-ctor30.C
inh-ctor31.C
inh-ctor32.C
inh-ctor33.C
inh-ctor34.C
inh-ctor35.C
inh-ctor35a.C
inh-ctor36.C
inh-ctor37.C
inh-ctor38.C
inh-ctor39.C c++: Dependent using enum [PR97874] 2021-01-27 15:08:05 -05:00
init-statement1.C
init-statement2.C
init-statement3.C
init-statement4.C
init-statement5.C
init-statement6.C
init-statement7.C
init-statement8.C
init-statement9.C
init-statement10.C
inline-var1.C
inline-var1.h
inline-var1a.C
inline-var2.C
inline-var3.C
inline-var4.C
inline-var5.C
inline-var6.C
inline-var7.C
inline-var8.C c++: Fix ICE with inline variable in template [PR97975] 2020-12-02 14:36:26 -05:00
inline-var9.C c++: C++17 constexpr static data member linkage [PR99901] 2021-04-06 14:30:02 -04:00
lambda-__func__.C
lambda-inherit1.C
lambda-this1.C
lambda-this2.C
lambda-this3.C
lambda-this4.C
lambda-this5.C
lambda-this6.C
lambda-this7.C
launder1.C
launder2.C
launder3.C
launder4.C
launder5.C
launder5.cc
launder5.h
launder6.C
launder6.cc
launder6.h
launder7.C
launder8.C
launder9.C
maybe_unused1.C
namespace-attribs2.C
namespace-attribs.C
nested-namespace-def1.C
nested-namespace-def2.C
nested-namespace-def3.C
nodiscard1.C
nodiscard2.C
nodiscard3.C
nodiscard4.C
nodiscard5.C
nodiscard6.C
nodiscard7.C
noexcept-type1.C
noexcept-type2.C
noexcept-type3.C
noexcept-type4.C
noexcept-type5.C
noexcept-type6.C
noexcept-type7.C
noexcept-type8.C
noexcept-type9.C
noexcept-type11.C
noexcept-type11a.C
noexcept-type12.C
noexcept-type13.C
noexcept-type14.C
noexcept-type15.C
noexcept-type16.C
noexcept-type17.C
noexcept-type18.C
noexcept-type19.C
noexcept-type19.h
noexcept-type20.C
noexcept-type21.C
noexcept-type22.C
noexcept-type23.C c++: Pointer-to-member fn conversion with noexcept [PR99374] 2021-03-05 18:00:02 -05:00
noexcept-type24.C c++: PMF template parm and noexcept [PR90664] 2021-04-03 01:54:03 -04:00
nontype1.C
nontype2.C
nontype3.C
nontype3a.C
nontype-auto1.C
nontype-auto2.C
nontype-auto3.C
nontype-auto4.C
nontype-auto5.C
nontype-auto6.C
nontype-auto7.C
nontype-auto8.C
nontype-auto9.C
nontype-auto10.C
nontype-auto11.C
nontype-auto12.C
nontype-auto13.C
nontype-auto14.C
nontype-auto15.C
nontype-auto16.C
nontype-auto17.C c++: Fix deduction from the type of an NTTP 2021-01-05 13:36:26 -05:00
nontype-auto18.C c++: Fix deduction from the type of an NTTP 2021-01-05 13:36:26 -05:00
pr78771.C
pr79143.C
pr81016.C
pr81349.C
pr83020.C
pr83644.C
pr83918.C
pr84325.C
pr84533.C
pr85569.C
pr86648.C
pr87814.C
pr92536.C
pr99790.C c++: Fix ICE on PTRMEM_CST in lambda in inline var initializer [PR99790] 2021-03-30 18:15:32 +02:00
range-for1.C
register1.C
register2.C
register3.C
regress1.C
regress2.C
static1.C
static2.C
static_assert-nomsg.C
ttp1.C
typename1.C
typename-tmpl-tmpl-parm-neg.C
typename-tmpl-tmpl-parm-ped-neg.C
typename-tmpl-tmpl-parm.C
udlit-utf8char.C
using1.C
using2.C
using3.C
using4.C
using5.C
using6.C
using7.C
using8.C
using9.C c++: Private parent access check for using decls [PR19377] 2021-03-17 19:11:02 -04:00
utf8-2.C
utf8-2a.C
utf8-neg.C
utf8.C
Wpessimizing-move1.C