File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1665,8 +1665,11 @@ SourceLocation CallExpr::getBeginLoc() const {
1665
1665
Method && Method->isExplicitObjectMemberFunction ()) {
1666
1666
bool HasFirstArg = getNumArgs () > 0 && getArg (0 );
1667
1667
assert (HasFirstArg);
1668
- if (HasFirstArg)
1669
- return getArg (0 )->getBeginLoc ();
1668
+ if (HasFirstArg) {
1669
+ if (auto FirstArgLoc = getArg (0 )->getBeginLoc (); FirstArgLoc.isValid ()) {
1670
+ return FirstArgLoc;
1671
+ }
1672
+ }
1670
1673
}
1671
1674
}
1672
1675
Original file line number Diff line number Diff line change @@ -1134,3 +1134,10 @@ struct S {
1134
1134
static_assert ((S{} << 11 ) == a);
1135
1135
// expected-error@-1 {{use of undeclared identifier 'a'}}
1136
1136
}
1137
+
1138
+ namespace GH135522 {
1139
+ struct S {
1140
+ auto f (this auto ) -> S;
1141
+ bool g () { return f (); } // expected-error {{no viable conversion from returned value of type 'S' to function return type 'bool'}}
1142
+ };
1143
+ }
You can’t perform that action at this time.
0 commit comments