Template instantiation for __builtin_choose_expr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72143 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-expr-3.cpp b/test/SemaTemplate/instantiate-expr-3.cpp
index abc2d92..df2bdc4 100644
--- a/test/SemaTemplate/instantiate-expr-3.cpp
+++ b/test/SemaTemplate/instantiate-expr-3.cpp
@@ -74,6 +74,7 @@
// __builtin_shufflevector
// ---------------------------------------------------------------------
typedef __attribute__(( ext_vector_type(2) )) double double2;
+
template<typename T, typename U, int N, int M>
struct ShuffleVector0 {
void f(T t, U u, double2 a, double2 b) {
@@ -85,3 +86,17 @@
template struct ShuffleVector0<double2, double2, 2, 1>;
template struct ShuffleVector0<double2, double2, 4, 3>; // expected-note{{instantiation}}
+
+// ---------------------------------------------------------------------
+// __builtin_choose_expr
+// ---------------------------------------------------------------------
+template<bool Cond, typename T, typename U, typename Result>
+struct Choose0 {
+ void f(T t, U u) {
+ Result r = __builtin_choose_expr(Cond, t, u); // expected-error{{lvalue}}
+ }
+};
+
+template struct Choose0<true, int, float, int&>;
+template struct Choose0<false, int, float, float&>;
+template struct Choose0<true, int, float, float&>; // expected-note{{instantiation}}