]> granicus.if.org Git - clang/commit
[c++20] P1064R0: Allow virtual function calls in constant expression
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 13 May 2019 23:35:21 +0000 (23:35 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 13 May 2019 23:35:21 +0000 (23:35 +0000)
commit3413400f823bef1658c557cfb0c0a115db64be44
tree1e3afe7a1d4d8d9ea73bceb42877863d65efc49d
parent826065ea2b47b6ecbb2b735735d7793686b95dc2
[c++20] P1064R0: Allow virtual function calls in constant expression
evaluation.

This reinstates r360559, reverted in r360580, with a fix to avoid
crashing if evaluation-for-overflow mode encounters a virtual call on an
object of a class with a virtual base class, and to generally not try to
resolve virtual function calls to objects whose (notional) vptrs are not
readable. (The standard rules are unclear here, but this seems like a
reasonable approach.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360635 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/AST/DeclCXX.h
include/clang/Basic/DiagnosticASTKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/AST/DeclCXX.cpp
lib/AST/ExprConstant.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaTemplateInstantiate.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp
test/CXX/drs/dr18xx.cpp
test/CXX/drs/dr6xx.cpp
test/SemaCXX/constant-expression-cxx2a.cpp
test/SemaCXX/cxx17-compat.cpp
test/SemaCXX/integer-overflow.cpp
www/cxx_status.html