https://bugs.llvm.org/show_bug.cgi?id=52473
Bug ID: 52473
Summary: false-positive -Wreturn-type error
Product: clang
Version: trunk
Hardware: PC
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: mkauf...@microsoft.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk
This is a regression somewhere between clang revision
`llvmorg-14-init-7378-gaee49255` and `llvmorg-14-init-8281-gaa1d32f5 - build
7378 has expected behavior.
Repro:
1. Save code below to file file `a.m`
2. Compile code: `bin/clang -Wreturn-type -Wno-objc-root-class -c -o a.o a.m`
```
@interface Bar
- (Bar*)baz;
- (Bar*)quux;
- (int)query;
@end
@implementation Bar
- (Bar* ) baz
{
@try {
@throw self;
} @catch (Bar*) {
return self;
}
return (Bar*)0;
}
@end
```
Expected behavior:
compilation is free from warnings
Actual behavior:
$ bin/clang -Wreturn-type -Wno-objc-root-class -c -o a.o a.m
a.m:14:1: warning: non-void function does not return a value in all control
paths [-Wreturn-type]
}
^
1 warning generated.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs