blob: 77e9e5815c2f90e4ce9b46a9dc1a26271ae19584 [file] [log] [blame]
Nick Lewyckyba5f6ec2010-04-24 01:30:46 +00001// RUN: %clang_cc1 -verify -std=c++0x %s
2// RUN: cp %s %t
Chad Rosier02a444d2011-05-02 20:39:21 +00003// RUN: %clang_cc1 -x c++ -std=c++0x -fixit %t || true
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}}