Relax assert in ExprConstant to a return None.
authorJon Chesterfield <jonathanchesterfield@gmail.com>
Thu, 21 Oct 2021 12:09:55 +0000 (13:09 +0100)
committerJon Chesterfield <jonathanchesterfield@gmail.com>
Thu, 21 Oct 2021 12:09:56 +0000 (13:09 +0100)
commit7ff4f48adb26429086d6fd85a14336e57cd340dc
tree0f8c8b96cb43bcfb0909cee653262cb8c9c0fdb4
parentb8b14b682c339c9ab85360d24ba9b888d52fdfbb
Relax assert in ExprConstant to a return None.

Fixes a compiler assert on passing a compile time integer to atomic builtins.

Assert introduced in D61522
Function changed from ->bool to ->Optional in D76646
Simplifies call sites to getIntegerConstantExpr to elide the now-redundant
isValueDependent checks.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D112159
clang/lib/AST/ExprConstant.cpp
clang/lib/Sema/SemaAttr.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaType.cpp
clang/test/SemaTemplate/atomics.cpp