[PATCH] D132944: [clang] cleanup -fstrict-flex-arrays implementation
James Y Knight via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 31 08:40:48 PDT 2022
jyknight added a comment.
#include <stdio.h>
#include <source_location>
consteval int fn(std::source_location sl = std::source_location::current()) {
return sl.line();
}
consteval int fn2(int line = fn()) {
return line;
}
int main() {
printf("fn=%d fn2=%d\n", fn(), fn2());
}
I believe this should print `fn=14 fn2=14`. I don't see how we can get that by special-casing calls to `std::source_location::current`, and indeed, with this version of the patch, the program instead prints `fn=14 fn2=9`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132944/new/
https://reviews.llvm.org/D132944
More information about the cfe-commits
mailing list