blob: 1c6c26f2586e3b0b4cd615f293555a5083f859ba [file] [log] [blame]
Anders Carlssonabea9512011-02-28 00:40:07 +00001// RUN: %clang_cc1 -fcxx-exceptions -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