Issue 92033
Summary [clang-cl] Using pointer to member as argument to template in the same class results in incorrect layout
Labels new issue
Assignees
Reporter erikolofsson
    https://godbolt.org/z/ddhddo9zP
### Reproduction
`-target x86_64-windows -std=c++23`
```
struct TestStruct {
};

template <auto memberPointer>
struct TestTemplate {
    constexpr static int constexprStaticValue = 0;

 template <int>
    struct InnerStruct {
    };

    using InnerType = InnerStruct<constexprStaticValue>;
};

struct TestRecursive {
    TestStruct link;
 TestTemplate<&TestRecursive::link> tree;
};

void TestFrame() {
 TestRecursive Test; 
}
```
### Warning
```
<source>:24:6: error: stack frame size (118115794992) exceeds limit (4294967295) in 'void __cdecl TestFrame(void)' [-Werror,-Wframe-larger-than
```

The same code works when targeting macOS or Linux. 

Cloud be related to: https://github.com/llvm/llvm-project/issues/80806

A workaround is to replace the `constexpr static` with an `enum`.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to