mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-03 20:46:05 +00:00

Summary: Assignment and comma operators for fixed-point types were being constevaled as other binary operators, but they need special treatment. Reviewers: rjmccall, leonardchan, bjope Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73189
21 lines
374 B
C
21 lines
374 B
C
// RUN: %clang_cc1 -verify -ffixed-point %s
|
|
|
|
union a {
|
|
_Accum x;
|
|
int i;
|
|
};
|
|
|
|
int fn1() {
|
|
union a m;
|
|
m.x = 5.6k;
|
|
return m.i;
|
|
}
|
|
|
|
int fn2() {
|
|
union a m;
|
|
m.x = 7, 5.6k; // expected-warning {{expression result unused}}
|
|
return m.x, m.i; // expected-warning {{expression result unused}}
|
|
}
|
|
|
|
_Accum acc = (0.5r, 6.9k); // expected-warning {{expression result unused}}
|