mirror of https://github.com/microsoft/clang.git
Perform placeholder conversions on the controller of a _Generic
expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174930 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9dd74c5504
commit
a2905ea609
|
@ -1173,6 +1173,12 @@ Sema::CreateGenericSelectionExpr(SourceLocation KeyLoc,
|
|||
TypeSourceInfo **Types,
|
||||
Expr **Exprs,
|
||||
unsigned NumAssocs) {
|
||||
if (ControllingExpr->getType()->isPlaceholderType()) {
|
||||
ExprResult result = CheckPlaceholderExpr(ControllingExpr);
|
||||
if (result.isInvalid()) return ExprError();
|
||||
ControllingExpr = result.take();
|
||||
}
|
||||
|
||||
bool TypeErrorFound = false,
|
||||
IsResultDependent = ControllingExpr->isTypeDependent(),
|
||||
ContainsUnexpandedParameterPack
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// expected-no-diagnostics
|
||||
|
||||
__attribute__((objc_root_class))
|
||||
@interface Root {
|
||||
Class isa;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface A
|
||||
@property (strong) id x;
|
||||
@end
|
||||
|
||||
// rdar://13193560
|
||||
void test0(A *a) {
|
||||
int kind = _Generic(a.x, id : 0, int : 1, float : 2);
|
||||
}
|
Loading…
Reference in New Issue