diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2016-02-23 18:55:15 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2016-02-23 18:55:15 +0000 |
commit | 558995c9671d094a1e405084a181c9eddab04ec8 (patch) | |
tree | e8f0cb8be1ceb79c57ef3e634d7fb87dae434127 /clang/test/Sema/generic-selection.c | |
parent | f7ae359d2c8ab309a1556a4365c52fab26281e3c (diff) | |
download | bcm5719-llvm-558995c9671d094a1e405084a181c9eddab04ec8.tar.gz bcm5719-llvm-558995c9671d094a1e405084a181c9eddab04ec8.zip |
Amends r252104 to evaluate the controlling expression in an unevaluated context. This eliminates false-positive diagnostics about null pointer dereferences (etc) in the controlling expression.
llvm-svn: 261669
Diffstat (limited to 'clang/test/Sema/generic-selection.c')
-rw-r--r-- | clang/test/Sema/generic-selection.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Sema/generic-selection.c b/clang/test/Sema/generic-selection.c index 0563ec0f4fc..5c02005d0fa 100644 --- a/clang/test/Sema/generic-selection.c +++ b/clang/test/Sema/generic-selection.c @@ -31,4 +31,8 @@ void foo(int n) { const int i = 12; int a9[_Generic(i, int: 1, default: 2) == 1 ? 1 : -1]; + + // This is expected to not trigger any diagnostics because the controlling + // expression is not evaluated. + (void)_Generic(*(int *)0, int: 1); } |