[flang] Fix length handling in character kind implicit conversion (#74586)
[llvm-project.git] / lldb / test / Shell / SymbolFile / PDB / Inputs / AstRestoreTest.cpp
blobfb20c9d734bd286ea971fb6b1e125124c577bb35
1 namespace N0 {
2 namespace N1 {
4 namespace {
5 enum Enum { Enum_0 = 1, Enum_1 = 2, Enum_2 = 4, Enum_3 = 8 };
6 enum class ScopedEnum { Enum_0 = 1, Enum_1 = 2, Enum_2 = 4, Enum_3 = 8 };
9 Enum Global = Enum_3;
11 struct Base {
12 Enum m_e = Enum_1;
15 class Class : public Base {
16 public:
17 Class(Enum e) : m_ce(e) {}
19 static int StaticFunc(const Class &c) {
20 return c.PrivateFunc(c.m_inner) + Global + ClassStatic;
23 const Enum m_ce;
25 static int ClassStatic;
26 static const int ClassStaticConst = 8;
27 static constexpr int ClassStaticConstexpr = 9;
28 static constexpr float ClassStaticConstexprFloat = 10.f;
29 static constexpr double ClassStaticConstexprDouble = 11.0;
30 static constexpr long double ClassStaticConstexprLongDouble = 12.0;
31 static const Enum ClassStaticConstEnum = Enum_3;
32 static const ScopedEnum ClassStaticConstScopedEnum = ScopedEnum::Enum_2;
34 private:
35 struct Inner {
36 char x;
37 short y;
38 int z;
41 int PrivateFunc(const Inner &i) const { return i.z; }
43 Inner m_inner{};
45 int Class::ClassStatic = 7;
47 template<typename T>
48 struct Template {
49 template<Enum E>
50 void TemplateFunc() {
51 T::StaticFunc(T(E));
55 void foo() { Template<Class>().TemplateFunc<Enum_0>(); }
57 } // namespace N1
58 } // namespace N0
60 int main() {
61 N0::N1::foo();
62 return 0;