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

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

Reply via email to