https://bugs.llvm.org/show_bug.cgi?id=39365
Bug ID: 39365
Summary: gnu address-of-label extension parsing has too-high
precedence
Product: clang
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: ztur...@google.com
CC: llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk
5 - https://godbolt.org/z/_XH9G1
struct foo
{
unsigned short operator!=(const foo &)
{
return 1;
}
};
extern void* p1;
extern void* p2;
extern foo f;
void bar()
{
if (f != (foo()) && p1 == p2)
{
}
}
Removing the parentheses or removing the second conditional makes this work.
Since this doesn't make sense as an address-of-label, we should prioritize
parsing this as what it actually is, which is ((f != foo()) && (p1 == p2))
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs