[clang][Interp] Fix diagnosing non-const variables pre-C++11 (#76718)
commit30d458626d4fb7adf94b195e98de240b491c86c9
authorTimm Baeder <tbaeder@redhat.com>
Thu, 18 Jan 2024 14:15:05 +0000 (18 15:15 +0100)
committerGitHub <noreply@github.com>
Thu, 18 Jan 2024 14:15:05 +0000 (18 15:15 +0100)
tree842c1e78db91dbb8854db08f85bdb22aa8d38d12
parent57f6a3f7ea9bae0c429cd3b8a69e3a8b1d0eed41
[clang][Interp] Fix diagnosing non-const variables pre-C++11 (#76718)

In CheckConstant(), consider that in C++98 const variables may not be read at all, and diagnose that accordingly.
clang/lib/AST/Interp/Interp.cpp
clang/test/AST/Interp/cxx11.cpp [new file with mode: 0644]
clang/test/AST/Interp/cxx98.cpp [new file with mode: 0644]