PR15966: don't get confused by a complex integer -> complex integer conversion
and misclassify it as a complex-real conversion. llvm-svn: 181626
This commit is contained in:
parent
300f0b966c
commit
b8a98241fc
|
@ -1591,7 +1591,7 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType,
|
|||
// Integral conversions (C++ 4.7).
|
||||
SCS.Second = ICK_Integral_Conversion;
|
||||
FromType = ToType.getUnqualifiedType();
|
||||
} else if (FromType->isAnyComplexType() && ToType->isComplexType()) {
|
||||
} else if (FromType->isAnyComplexType() && ToType->isAnyComplexType()) {
|
||||
// Complex conversions (C99 6.3.1.6)
|
||||
SCS.Second = ICK_Complex_Conversion;
|
||||
FromType = ToType.getUnqualifiedType();
|
||||
|
|
|
@ -42,9 +42,15 @@ void test_promote_or_convert2(float _Complex fc) {
|
|||
int *cp = promote_or_convert2(fc);
|
||||
}
|
||||
|
||||
char *promote_or_convert3(int _Complex);
|
||||
int *promote_or_convert3(long _Complex);
|
||||
char *promote_or_convert3(int _Complex); // expected-note {{candidate}}
|
||||
int *promote_or_convert3(long _Complex); // expected-note {{candidate}}
|
||||
|
||||
void test_promote_or_convert3(short _Complex sc) {
|
||||
char *cp = promote_or_convert3(sc);
|
||||
char *cp1 = promote_or_convert3(sc);
|
||||
char *cp2 = promote_or_convert3(1i);
|
||||
int *cp3 = promote_or_convert3(1il);
|
||||
int *cp4 = promote_or_convert3(1ill); // expected-error {{ambiguous}}
|
||||
}
|
||||
|
||||
char &convert4(short _Complex);
|
||||
char &test_convert4 = convert4(1i);
|
||||
|
|
Loading…
Reference in New Issue