summaryrefslogtreecommitdiffstats
path: root/test/Analysis/delayed-template-parsing-crash.cpp
blob: 6d189afb455a2af9fc3da281f88522aae1f8fb90 (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: %clang_analyze_cc1 -analyzer-checker=core -std=c++11 -fdelayed-template-parsing -verify %s
// expected-no-diagnostics

template <class T> struct remove_reference      {typedef T type;};
template <class T> struct remove_reference<T&>  {typedef T type;};
template <class T> struct remove_reference<T&&> {typedef T type;};

template <typename T>
typename remove_reference<T>::type&& move(T&& arg) { // this used to crash
  return static_cast<typename remove_reference<T>::type&&>(arg);
}