File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,9 @@ APValue Pointer::toAPValue() const {
152152 Pointer Ptr = *this ;
153153 while (Ptr.isField () || Ptr.isArrayElement ()) {
154154 if (Ptr.isArrayRoot ()) {
155- Path.push_back (APValue::LValuePathEntry::ArrayIndex (0 ));
156- Ptr = Ptr.getBase ();
155+ Path.push_back (APValue::LValuePathEntry (
156+ {Ptr.getFieldDesc ()->asDecl (), /* IsVirtual=*/ false }));
157+ Ptr = Ptr.getBase ();
157158 } else if (Ptr.isArrayElement ()) {
158159 if (Ptr.isOnePastEnd ())
159160 Path.push_back (APValue::LValuePathEntry::ArrayIndex (Ptr.getArray ().getNumElems ()));
Original file line number Diff line number Diff line change @@ -644,3 +644,21 @@ namespace FunctionCast {
644644 // both-warning {{are a Clang extension}}
645645 int b[(int )IntFn(f)()]; // ok
646646}
647+
648+ #if __cplusplus >= 202002L
649+ namespace StableAddress {
650+ template <unsigned N> struct str {
651+ char arr[N];
652+ };
653+ // FIXME: Deduction guide not needed with P1816R0.
654+ template <unsigned N> str (const char (&)[N]) -> str<N>;
655+
656+ template <str s> constexpr int sum () {
657+ int n = 0 ;
658+ for (char c : s.arr )
659+ n += c;
660+ return n;
661+ }
662+ static_assert (sum<str{" $hello $world." }>() == 1234, "");
663+ }
664+ #endif
You can’t perform that action at this time.
0 commit comments