They must be evaluated in the context where default argument is actually
used during a call, not in a parameter list where default argument is specified.
Fixes #56379.
Paths
| Differential D132941
[DO NOT SUBMIT] [Sema] Delay evaluation of std::source_location::current() in default arguments Needs ReviewPublic Authored by ilya-biryukov on Aug 30 2022, 7:26 AM.
Details
Summary They must be evaluated in the context where default argument is actually Fixes #56379.
Diff Detail
Event TimelineComment Actions I think this is superseded by https://cplusplus.github.io/CWG/issues/2631.html and its resolution. Comment Actions
LG, thanks for taking this over. Comment Actions The PR for the more general approach (note that it does not solve source location, that will need more additional work) https://reviews.llvm.org/D136554
Revision Contents
Diff 456664 clang/include/clang/AST/CurrentSourceLocExprScope.h
clang/include/clang/AST/Expr.h
clang/include/clang/AST/ExprCXX.h
clang/include/clang/AST/Stmt.h
clang/include/clang/AST/TextNodeDumper.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/ASTImporter.cpp
clang/lib/AST/Expr.cpp
clang/lib/AST/ExprConstant.cpp
clang/lib/AST/TextNodeDumper.cpp
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/Sema/SemaDeclCXX.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Serialization/ASTReaderStmt.cpp
clang/lib/Serialization/ASTWriterStmt.cpp
clang/test/CodeGenCXX/builtin-source-location.cpp
clang/test/SemaCXX/source_location.cpp
clang/test/SemaCXX/source_location_consteval.cpp
|