blob: f1ffd06334c3e0f441a435f8c385cf8bc0aab060 [file] [log] [blame]
Anders Carlssone41721e2011-02-19 19:23:03 +00001// RUN: %clang_cc1 -fexceptions -fsyntax-only -std=c++0x -verify %s
Douglas Gregor2f2433f2009-05-18 21:08:14 +00002
3template<typename T> struct TryCatch0 {
4 void f() {
5 try {
6 } catch (T&&) { // expected-error 2{{cannot catch exceptions by rvalue reference}}
7 }
8 }
9};
10
11template struct TryCatch0<int&>; // okay
12template struct TryCatch0<int&&>; // expected-note{{instantiation}}
13template struct TryCatch0<int>; // expected-note{{instantiation}}
14