diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-12 23:18:54 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-12 23:18:54 +0000 |
commit | d1e4d9bfd57f643d950eb1373f582bda4dfb8dc7 (patch) | |
tree | ae0d1106fa72edcba9623a87bba19aa460128983 /test/Sema/self-comparison.c | |
parent | 58002f96837562a09e2b828590c8c2580d32f020 (diff) |
Don't emit string-comparison or self-comparison warnings in
unevaluated contexts, because they only matter for code that will
actually be evaluated at runtime.
As part of this, I had to extend PartialDiagnostic to support fix-it
hints.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/self-comparison.c')
-rw-r--r-- | test/Sema/self-comparison.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/self-comparison.c b/test/Sema/self-comparison.c index b2b06c209a..1baba2755f 100644 --- a/test/Sema/self-comparison.c +++ b/test/Sema/self-comparison.c @@ -31,3 +31,8 @@ int compare_enum() { enum { A }; return A == A; // no-warning } + +// Don't complain in unevaluated contexts. +int compare_sizeof(int x) { + return sizeof(x == x); // no-warning +} |