diff options
author | Eric Fiselier <eric@efcs.ca> | 2019-03-08 22:06:48 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2019-03-08 22:06:48 +0000 |
commit | 680e865c313a80b6ec329abde61e1f0c66bdc103 (patch) | |
tree | 954b51afa72878ff67d2e15101aecc6e715a395a /lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h | |
parent | ae8fe4e0931468456e5d15303304138c6f253d53 (diff) | |
download | bcm5719-llvm-680e865c313a80b6ec329abde61e1f0c66bdc103.tar.gz bcm5719-llvm-680e865c313a80b6ec329abde61e1f0c66bdc103.zip |
[8.0 Regression] Fix handling of `__builtin_constant_p` inside template arguments, enumerators, case statements, and the enable_if attribute.
Summary:
The following code is accepted by Clang 7 and prior but rejected by the upcoming 8 release and in trunk [1]
```
// error {{never produces a constant expression}}
void foo(const char* s) __attribute__((enable_if(__builtin_constant_p(*s) == false, "trap"))) {}
void test() { foo("abc"); }
```
Prior to Clang 8, the call to `__builtin_constant_p` was a constant expression returning false. Currently, it's not a valid constant expression.
The bug is caused because we failed to set `InConstantContext` when attempting to evaluate unevaluated constant expressions.
[1] https://godbolt.org/z/ksAjmq
Reviewers: rsmith, hans, sbenza
Reviewed By: rsmith
Subscribers: kristina, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59038
llvm-svn: 355743
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h')
0 files changed, 0 insertions, 0 deletions