DR1213: element access on an array xvalue or prvalue produces an xvalue. In the
latter case, a temporary array object is materialized, and can be lifetime-extended by binding a reference to the member access. Likewise, in an array-to-pointer decay, an rvalue array is materialized before being converted into a pointer. This caused IR generation to stop treating file-scope array compound literals as having static storage duration in some cases in C++; that has been rectified by modeling such a compound literal as an lvalue. This also improves clang's compatibility with GCC for those cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288654 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/AST/ExprClassification.cpp 13 additions, 5 deletionslib/AST/ExprClassification.cpp
- lib/AST/ExprConstant.cpp 3 additions, 3 deletionslib/AST/ExprConstant.cpp
- lib/Sema/Sema.cpp 12 additions, 0 deletionslib/Sema/Sema.cpp
- lib/Sema/SemaExpr.cpp 33 additions, 5 deletionslib/Sema/SemaExpr.cpp
- lib/Sema/SemaInit.cpp 4 additions, 3 deletionslib/Sema/SemaInit.cpp
- lib/StaticAnalyzer/Core/ExprEngineC.cpp 1 addition, 9 deletionslib/StaticAnalyzer/Core/ExprEngineC.cpp
- test/Analysis/explain-svals.cpp 1 addition, 1 deletiontest/Analysis/explain-svals.cpp
- test/CXX/drs/dr12xx.cpp 11 additions, 0 deletionstest/CXX/drs/dr12xx.cpp
- test/CodeGenCXX/compound-literals.cpp 17 additions, 7 deletionstest/CodeGenCXX/compound-literals.cpp
- test/CodeGenCXX/stack-reuse.cpp 1 addition, 1 deletiontest/CodeGenCXX/stack-reuse.cpp
- test/CodeGenCXX/temporaries.cpp 30 additions, 0 deletionstest/CodeGenCXX/temporaries.cpp
- test/SemaCXX/constant-expression-cxx11.cpp 20 additions, 7 deletionstest/SemaCXX/constant-expression-cxx11.cpp
- www/cxx_dr_status.html 1 addition, 1 deletionwww/cxx_dr_status.html
Loading
Please register or sign in to comment