Commit Graph

6 Commits

Author SHA1 Message Date
George Burgess IV 94cbbb8257 Properly construct `inline` members without initializers
Digging through commit logs, it appears the checks in this block predate
`inline` class variables. With them, we fail to emit dynamic
initializers for members that don't have an explicit initializer, and we
won't go out of our way to instantiate the class denoted by
`Var->getType()`.

Fixes PR35599.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327945 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 03:27:44 +00:00
Richard Smith 48cc498f2d In C++17, when instantiating an out-of-line definition of an inline static data
member, don't forget to instantiate the initializer too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322236 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-10 23:08:26 +00:00
Richard Smith 9982bd2e77 [c++17] Visit class template explicit specializations just like all other class definitions in codegen.
If an explicit specialization has a static data member, it may be a definition and we may need to register it for emission.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317296 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-03 01:26:01 +00:00
Richard Smith ef34bcb258 For better compatibility with C++11 and C++14, emit a nondiscardable definition
of a static constexpr data member if it's defined 'constexpr' out of line, not
only if it's defined 'constexpr' in the class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-23 03:58:34 +00:00
Richard Smith f82fb5beb8 PR28394: For compatibility with c++11 and c++14, if a static constexpr data
member is redundantly redeclared outside the class definition in code built in
c++17 mode, ensure we emit a non-discardable definition of the data member for
c++11 and c++14 compilations to use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 01:32:16 +00:00
Richard Smith 3c1c202ada Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives a
variable weak discardable linkage and partially-ordered initialization, and is
implied for constexpr static data members.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25 00:15:56 +00:00