[clang] Treat function parameter scope as an immediate function context
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Tue, 7 Mar 2023 16:33:57 +0000 (11:33 -0500)
committerMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Tue, 7 Mar 2023 16:46:26 +0000 (11:46 -0500)
commita2739f111d9795fe49109c26c2d816436f2143c3
tree4d150cf160935aca119df229e5a1ca6c11d4fc0c
parentf1440bf6fd22ca0a5fc3594000e966201989fd48
[clang] Treat function parameter scope as an immediate function context

This results in expressions that appear in default function argument not
being checked for being actual constant expressions.
This aligns clang's behavior with the standard and fixes one of the
examples from https://wg21.link/P1073R3.

Reviewed By: shafik, cor3ntin

Differential Revision: https://reviews.llvm.org/D145251
clang/lib/Sema/SemaExpr.cpp
clang/test/CXX/expr/expr.const/p6-2a.cpp