diff --git a/clang/lib/AST/FormatString.cpp b/clang/lib/AST/FormatString.cpp index fcc0b3b11e259e..e9f6b88631af5b 100644 --- a/clang/lib/AST/FormatString.cpp +++ b/clang/lib/AST/FormatString.cpp @@ -539,7 +539,7 @@ QualType ArgType::getRepresentativeType(ASTContext &C) const { } std::string ArgType::getRepresentativeTypeName(ASTContext &C) const { - std::string S = getRepresentativeType(C).getAsString(); + std::string S = getRepresentativeType(C).getAsString(C.getPrintingPolicy()); std::string Alias; if (Name) { diff --git a/clang/test/SemaOpenCL/printf-format-strings.cl b/clang/test/SemaOpenCL/printf-format-strings.cl index 0cfeeb13579600..6cdfc7e60b3796 100644 --- a/clang/test/SemaOpenCL/printf-format-strings.cl +++ b/clang/test/SemaOpenCL/printf-format-strings.cl @@ -65,8 +65,8 @@ kernel void format_v4f64(half4 arg_h, float4 arg_f, double4 arg_d) kernel void format_v4f16(half4 arg_h, float4 arg_f, double4 arg_d) { - printf("%v4hf\n", arg_d); // expected-warning{{format specifies type '__fp16 __attribute__((ext_vector_type(4)))' but the argument has type 'double4' (vector of 4 'double' values)}} - printf("%v4hf\n", arg_f); // expected-warning{{format specifies type '__fp16 __attribute__((ext_vector_type(4)))' but the argument has type 'float4' (vector of 4 'float' values)}} + printf("%v4hf\n", arg_d); // expected-warning{{format specifies type 'half __attribute__((ext_vector_type(4)))' but the argument has type 'double4' (vector of 4 'double' values)}} + printf("%v4hf\n", arg_f); // expected-warning{{format specifies type 'half __attribute__((ext_vector_type(4)))' but the argument has type 'float4' (vector of 4 'float' values)}} printf("%v4hf\n", arg_h); }