aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-expr-3.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-19 22:43:30 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-19 22:43:30 +0000
commitc9ecc57d6d1fd4a96c748e52958d70be3b3da9fb (patch)
treec16c5c2fd1b80f6e1075c5b814ceaf7c0ed99f1a /test/SemaTemplate/instantiate-expr-3.cpp
parentc12a9c5e552825c2b7d2e4352a9f70e061ebb367 (diff)
Template instantiation for __builtin_choose_expr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72143 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-3.cpp')
-rw-r--r--test/SemaTemplate/instantiate-expr-3.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-3.cpp b/test/SemaTemplate/instantiate-expr-3.cpp
index abc2d92c6d..df2bdc4261 100644
--- a/test/SemaTemplate/instantiate-expr-3.cpp
+++ b/test/SemaTemplate/instantiate-expr-3.cpp
@@ -74,6 +74,7 @@ template struct StatementExpr0<N1::X>; // expected-note{{instantiation}}
// __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 @@ struct ShuffleVector0 {
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}}