blob: b158251915a0802b4ecc9b14d82b4d3282be6280 [file] [log] [blame]
Douglas Gregorde650ae2009-03-31 18:38:02 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3template<template<typename T> class MetaFun, typename Value>
4struct apply {
5 typedef typename MetaFun<Value>::type type;
6};
7
8template<class T>
9struct add_pointer {
10 typedef T* type;
11};
12
13template<class T>
14struct add_reference {
15 typedef T& type;
16};
17
18int i;
19apply<add_pointer, int>::type ip = &i;
20apply<add_reference, int>::type ir = i;
21apply<add_reference, float>::type fr = i; // expected-error{{non-const lvalue reference to type 'float' cannot be initialized with a value of type 'int'}}