Index: lib/Sema/SemaType.cpp =================================================================== --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -7350,6 +7350,9 @@ (D.getContext() == DeclaratorContext::MemberContext && (!IsPointee && D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_static)) || + // Do not deduce if we are in type alias because it doesn't define any + // object. + (D.getContext() == DeclaratorContext::AliasDeclContext) || // Do not deduce addr space for types used to define a typedef and the // typedef itself, except the pointee type of a pointer type which is used // to define the typedef. Index: test/SemaOpenCLCXX/address-space-deduction.cl =================================================================== --- test/SemaOpenCLCXX/address-space-deduction.cl +++ test/SemaOpenCLCXX/address-space-deduction.cl @@ -23,3 +23,13 @@ int foo[10]; xxx(&foo[0]); } + +struct c1 {}; + +// We don't deduce addr space in type alias. +//CHECK: TypeAliasDecl {{.*}} referenced alias_c1 'c1' +using alias_c1 = c1; + +struct c2 { + alias_c1 y; +};