[Sema] Don't treat a non-null template argument as if it were null.
authorEli Friedman <efriedma@quicinc.com>
Wed, 19 Oct 2022 21:40:52 +0000 (14:40 -0700)
committerEli Friedman <efriedma@quicinc.com>
Wed, 19 Oct 2022 21:40:52 +0000 (14:40 -0700)
commit795f67934d38c2c080aa65f5244dcbdccdbd1154
treebd6b54412c4aae97c6fd3689052a4d6d2472cdc4
parente5d9ab08c39aa674def376dcffead2242a097536
[Sema] Don't treat a non-null template argument as if it were null.

The way this code checks whether a pointer is null is wrong for other
reasons; it doesn't actually check whether a null pointer constant is a
"constant" in the C++ standard sense.  But this fix at least makes sure
we don't treat a non-null pointer as if it were null.

Fixes https://github.com/llvm/llvm-project/issues/57883

Differential Revision: https://reviews.llvm.org/D134928
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaTemplate.cpp
clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1-11.cpp
clang/test/CXX/temp/temp.arg/temp.arg.nontype/p1.cpp