blob: c3c1dcf20f5dd7c7c61bc0464a6413bf6123e038 [file] [log] [blame]
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +00001// RUN: %clang_cc1 -verify -std=c++0x %s
2// RUN: cp %s %t
Richard Smith23153182011-09-06 03:01:15 +00003// RUN: not %clang_cc1 -x c++ -std=c++0x -fixit %t
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +00004// RUN: %clang_cc1 -Wall -pedantic -x c++ -std=c++0x %t
Douglas Gregor84fb9c02009-11-23 13:46:08 +00005
6/* This is a test of the various code modification hints that only
7 apply in C++0x. */
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +00008struct A {
Douglas Gregor84fb9c02009-11-23 13:46:08 +00009 explicit operator int(); // expected-note{{conversion to integral type}}
10};
11
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +000012void x() {
Douglas Gregor84fb9c02009-11-23 13:46:08 +000013 switch(A()) { // expected-error{{explicit conversion to}}
14 }
15}
16
Richard Smith162e1c12011-04-15 14:24:37 +000017using ::T = void; // expected-error {{name defined in alias declaration must be an identifier}}
18using typename U = void; // expected-error {{name defined in alias declaration must be an identifier}}
19using typename ::V = void; // expected-error {{name defined in alias declaration must be an identifier}}