Major New Features
------------------
+- Clang uses the new MingW ABI
+GCC 4.7 changed the mingw ABI. Clang 3.4 and older use the GCC 4.6
+ABI. Clang 3.5 and newer use the GCC 4.7 abi.
+
+
Improvements to Clang's diagnostics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
CallingConv getDefaultMethodCallConv(bool isVariadic) const {
+ const llvm::Triple &T = Context.getTargetInfo().getTriple();
+ if (!isVariadic && T.getOS() == llvm::Triple::MinGW32 &&
+ T.getArch() == llvm::Triple::x86)
+ return CC_X86ThisCall;
return CC_C;
}
};
void test(A &a) {
- if (a) return; // expected-error {{'operator void *(class test8::A::*)(void) const' is a private member of 'test8::A'}}
+ if (a) return; // expected-error-re {{'operator void *(class test8::A::*)(void) {{.*}}const' is a private member of 'test8::A'}}
}
}
struct S {
template<typename T> constexpr T f(); // expected-warning {{C++1y}}
template <typename T>
- T g() const; // expected-note {{candidate template ignored: could not match 'T () const' against 'char ()'}}
+ T g() const; // expected-note-re {{candidate template ignored: could not match 'T () {{.*}}const' against 'char (){{.*}}'}}
};
// explicit specialization can differ in constepxr
template int f<&S::operator int>(); // expected-error {{does not refer to a function template}}
template int f<(bool)&S::operator int>();
-int n = Val<bool, &S::operator int>::value; // expected-error {{conversion from 'int (S::*)() const' to 'bool' is not allowed in a converted constant expression}}
+int n = Val<bool, &S::operator int>::value; // expected-error-re {{conversion from 'int (S::*)() {{.*}}const' to 'bool' is not allowed in a converted constant expression}}
namespace NonConstLValue {
struct S {
(p->*pmv)();
(p->*pmcv)();
- (pc->*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const' qualifier}}
+ (pc->*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const' qualifier}}
(pc->*pmc)();
- (pc->*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+ (pc->*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
(pc->*pmcv)();
- (pv->*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'volatile' qualifier}}
- (pv->*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
+ (pv->*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'volatile' qualifier}}
+ (pv->*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
(pv->*pmv)();
(pv->*pmcv)();
- (pcv->*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const volatile' qualifiers}}
- (pcv->*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
- (pcv->*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+ (pcv->*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const volatile' qualifiers}}
+ (pcv->*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
+ (pcv->*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
(pcv->*pmcv)();
(o.*pm)();
(o.*pmv)();
(o.*pmcv)();
- (oc.*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const' qualifier}}
+ (oc.*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const' qualifier}}
(oc.*pmc)();
- (oc.*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+ (oc.*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
(oc.*pmcv)();
- (ov.*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'volatile' qualifier}}
- (ov.*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
+ (ov.*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'volatile' qualifier}}
+ (ov.*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
(ov.*pmv)();
(ov.*pmcv)();
- (ocv.*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const volatile' qualifiers}}
- (ocv.*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
- (ocv.*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+ (ocv.*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const volatile' qualifiers}}
+ (ocv.*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
+ (ocv.*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
(ocv.*pmcv)();
}
// Lvalue ref-qualifier.
(lvalue<X>().*l_pmf)(17);
- (xvalue<X>().*l_pmf)(17); // expected-error{{pointer-to-member function type 'int (X::*)(int) &' can only be called on an lvalue}}
- (prvalue<X>().*l_pmf)(17); // expected-error{{pointer-to-member function type 'int (X::*)(int) &' can only be called on an lvalue}}
+ (xvalue<X>().*l_pmf)(17); // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&' can only be called on an lvalue}}
+ (prvalue<X>().*l_pmf)(17); // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&' can only be called on an lvalue}}
(xp->*l_pmf)(17);
// Rvalue ref-qualifier.
- (lvalue<X>().*r_pmf)(17); // expected-error{{pointer-to-member function type 'int (X::*)(int) &&' can only be called on an rvalue}}
+ (lvalue<X>().*r_pmf)(17); // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&&' can only be called on an rvalue}}
(xvalue<X>().*r_pmf)(17);
(prvalue<X>().*r_pmf)(17);
- (xp->*r_pmf)(17); // expected-error{{pointer-to-member function type 'int (X::*)(int) &&' can only be called on an rvalue}}
+ (xp->*r_pmf)(17); // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&&' can only be called on an rvalue}}
}
-// RUN: %clang_cc1 -std=c++11 -fblocks %s -verify
+// RUN: %clang_cc1 -triple i686-pc-linux -std=c++11 -fblocks %s -verify
void block_capture_errors() {
__block int var; // expected-note 2{{'var' declared here}}
template<typename T> void g(T);
void test() {
- foo(&g<int>); // expected-error {{can't form member pointer of type 'void (test0::A::*)(int)' without '&' and class name}}
+ foo(&g<int>); // expected-error-re {{can't form member pointer of type 'void (test0::A::*)(int){{.*}}' without '&' and class name}}
}
};
}
template<int (Y::*)(int)> struct X0 {}; // expected-note{{template parameter is declared here}}
X0<&Y::f> x0a;
X0<&Y::g> x0b;
- X0<&Y::h> x0c; // expected-error{{non-type template argument of type 'float (pointer_to_member_function::Y::*)(float)' cannot be converted to a value of type 'int (pointer_to_member_function::Y::*)(int)'}}
+ X0<&Y::h> x0c; // expected-error-re{{non-type template argument of type 'float (pointer_to_member_function::Y::*)(float){{.*}}' cannot be converted to a value of type 'int (pointer_to_member_function::Y::*)(int){{.*}}'}}
}
// -- For a non-type template-parameter of type pointer to data member,
}
}
-// CHECK-LABEL: define void @_ZN1N1X1fEv
+// CHECK-LABEL: define {{.*}}void @_ZN1N1X1fEv
extern "C" {
static void test2_f() {
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
struct A {};
A& (A::*x)(const A&) = &A::operator=;
-// CHECK-LABEL: define linkonce_odr %struct.A* @_ZN1AaSERKS_
+// CHECK-LABEL: define linkonce_odr {{.*}}%struct.A* @_ZN1AaSERKS_
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck -check-prefix GCABI %s
+// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm %s -o - | FileCheck -check-prefix GCABI %s
// RUN: %clang_cc1 -emit-llvm %s -o - -DMS_ABI -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck -check-prefix MSABI %s
#ifdef MS_ABI
--- /dev/null
+// RUN: %clang_cc1 -emit-llvm -triple i386-pc-mingw32 %s -o - | FileCheck --check-prefix=MINGW %s
+// RUN: %clang_cc1 -emit-llvm -triple i386-pc-cygwin %s -o - | FileCheck --check-prefix=CYGWIN %s
+
+namespace test1 {
+ struct foo {
+ // MINGW: declare x86_thiscallcc void @_ZN5test13foo1fEv
+ // CYGWIN: declare void @_ZN5test13foo1fEv
+ void f();
+ };
+ void g(foo *x) {
+ x->f();
+ }
+}
// This was a problem in Sema, but only shows up as noinline missing
// in CodeGen.
-// CHECK: define linkonce_odr void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) [[NI:#[0-9]+]]
+// CHECK: define linkonce_odr {{.*}}void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) [[NI:#[0-9]+]]
template <class Ty> struct Vector {
void growStorageBy();
#pragma weak foo
struct S { void foo(); };
void S::foo() {}
-// CHECK-LABEL: define void @_ZN1S3fooEv(
+// CHECK-LABEL: define {{.*}}void @_ZN1S3fooEv(
#pragma weak zed
namespace bar { void zed() {} }
// Verify that symbols are hidden.
// CHECK: @_ZN1CIiE5Inner6Inner26StaticE = weak_odr hidden global
-// CHECK-LABEL: define weak_odr hidden void @_ZN1CIiE5Inner1fEv
-// CHECK-LABEL: define weak_odr hidden void @_ZN1CIiE5Inner6Inner21gEv
+// CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1CIiE5Inner1fEv
+// CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1CIiE5Inner6Inner21gEv
template<typename T>
struct C {
};
Foo::~Foo() {}
-// CHECK-LABEL: define void @_ZN3FooD0Ev(%class.Foo* %this) unnamed_addr
+// CHECK-LABEL: define {{.*}}void @_ZN3FooD0Ev(%class.Foo* %this) unnamed_addr
};
void f(A *a) {
- // CHECK: call void %
+ // CHECK: call {{.*}}void %
a->f('c');
}
// CHECK: @_ZN15VirtualNoreturn1f
void f(A *p) {
p->f();
- // CHECK: call void %{{[^#]*$}}
+ // CHECK: call {{.*}}void %{{[^#]*$}}
// CHECK-NOT: unreachable
}
}
// <rdar://problem/8109763>
void test_X(X<int> xi, X<char> xc) {
- // CHECK-LABEL: define weak_odr hidden void @_ZN1XIiE1fEv
+ // CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1XIiE1fEv
xi.f();
- // CHECK-LABEL: define weak_odr hidden void @_ZN1XIiE1gEv
+ // CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1XIiE1gEv
xi.g();
- // CHECK: declare void @_ZN1XIcE1fEv
+ // CHECK: declare {{.*}}void @_ZN1XIcE1fEv
xc.f();
- // CHECK-LABEL: define available_externally void @_ZN1XIcE1gEv
+ // CHECK-LABEL: define available_externally {{.*}}void @_ZN1XIcE1gEv
xc.g();
}
// gcc.
// Not a use. gcc forgets to do the assignment.
- // CHECK-NEXT: call
+ // CHECK-NEXT: call {{.*}}void
((a=a),a);
// Not a use. gcc gets this wrong, it doesn't emit the copy!
- // CHECK-NEXT: call
+ // CHECK-NEXT: call {{.*}}void
(void)(a=a);
// Not a use. gcc got this wrong in 4.2 and omitted the side effects
};
// RUN: c-index-test -test-print-type -std=c++11 %s | FileCheck %s
-// CHECK: CXXMethod=f:2:8 (Definition) [type=void () &] [typekind=FunctionProto] lvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
-// CHECK: CXXMethod=f:3:8 (Definition) [type=void () &&] [typekind=FunctionProto] rvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
+// CHECK: CXXMethod=f:2:8 (Definition) [type=void () {{.*}}&] [typekind=FunctionProto] lvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
+// CHECK: CXXMethod=f:3:8 (Definition) [type=void () {{.*}}&&] [typekind=FunctionProto] rvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
// CHECK: TypeRef=T:3:19 [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0]
// CHECK: Namespace=inner:8:11 (Definition) [type=] [typekind=Invalid] [isPOD=0]
// CHECK: StructDecl=Bar:10:8 (Definition) [type=outer::inner::Bar] [typekind=Record] [isPOD=0]
-// CHECK: CXXConstructor=Bar:11:3 (Definition) [type=void (outer::Foo<bool> *)] [typekind=FunctionProto] [canonicaltype=void (outer::Foo<bool> *)] [canonicaltypekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [args= [outer::Foo<bool> *] [Pointer]] [isPOD=0]
+// CHECK: CXXConstructor=Bar:11:3 (Definition) [type=void (outer::Foo<bool> *){{.*}}] [typekind=FunctionProto] [canonicaltype=void (outer::Foo<bool> *){{.*}}] [canonicaltypekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [args= [outer::Foo<bool> *] [Pointer]] [isPOD=0]
// CHECK: ParmDecl=foo:11:25 (Definition) [type=outer::Foo<bool> *] [typekind=Pointer] [canonicaltype=outer::Foo<bool> *] [canonicaltypekind=Pointer] [isPOD=1]
// CHECK: NamespaceRef=outer:1:11 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: TemplateRef=Foo:4:8 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0]
// CHECK: TypedefDecl=FooType:13:15 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
// CHECK: FieldDecl=p:14:8 (Definition) [type=int *] [typekind=Pointer] [isPOD=1]
-// CHECK: CXXMethod=f:15:8 (Definition) [type=int *(int *, char *, FooType)] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int)] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef]] [isPOD=0]
+// CHECK: CXXMethod=f:15:8 (Definition) [type=int *(int *, char *, FooType){{.*}}] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int){{.*}}] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef]] [isPOD=0]
// CHECK: ParmDecl=p:15:15 (Definition) [type=int *] [typekind=Pointer] [isPOD=1]
// CHECK: ParmDecl=x:15:24 (Definition) [type=char *] [typekind=Pointer] [isPOD=1]
// CHECK: ParmDecl=z:15:35 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
-// RUN: %clang_cc1 %s -emit-llvm -o - -chain-include %s -chain-include %s | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple i686-pc-linux -o - -chain-include %s -chain-include %s | FileCheck %s
// CHECK: define linkonce_odr %{{[^ ]+}} @_ZN1AI1BE3getEv
#if !defined(PASS1)
#define PASS1
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t -verify %s -ast-dump -o -
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s
-// CHECK: define weak_odr void @_ZN2S4IiE1mEv
-// CHECK: define linkonce_odr void @_ZN2S3IiE1mEv
+// CHECK: define weak_odr {{.*}}void @_ZN2S4IiE1mEv
+// CHECK: define linkonce_odr {{.*}}void @_ZN2S3IiE1mEv
struct A {
typedef int type;
// CHECK: call {{.*}} @_ZN1SC1ERKS_
// CHECK: [C setPosition:]
-// CHECK: call %struct.S* @_ZN1SaSERKS_
+// CHECK: call {{.*}} %struct.S* @_ZN1SaSERKS_
// CHECK: [C .cxx_destruct]
// CHECK: [C .cxx_construct]
void QualifierTest() {
void (Qualifiers::*X)();
- X = &Qualifiers::C; // expected-error {{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const': different qualifiers (none vs const)}}
- X = &Qualifiers::V; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() volatile': different qualifiers (none vs volatile)}}
- X = &Qualifiers::R; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() restrict': different qualifiers (none vs restrict)}}
- X = &Qualifiers::CV; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const volatile': different qualifiers (none vs const and volatile)}}
- X = &Qualifiers::CR; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const restrict': different qualifiers (none vs const and restrict)}}
- X = &Qualifiers::VR; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() volatile restrict': different qualifiers (none vs volatile and restrict)}}
- X = &Qualifiers::CVR; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const volatile restrict': different qualifiers (none vs const, volatile, and restrict)}}
+ X = &Qualifiers::C; // expected-error-re {{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const': different qualifiers (none vs const)}}
+ X = &Qualifiers::V; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}volatile': different qualifiers (none vs volatile)}}
+ X = &Qualifiers::R; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}restrict': different qualifiers (none vs restrict)}}
+ X = &Qualifiers::CV; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const volatile': different qualifiers (none vs const and volatile)}}
+ X = &Qualifiers::CR; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const restrict': different qualifiers (none vs const and restrict)}}
+ X = &Qualifiers::VR; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}volatile restrict': different qualifiers (none vs volatile and restrict)}}
+ X = &Qualifiers::CVR; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const volatile restrict': different qualifiers (none vs const, volatile, and restrict)}}
}
struct Dummy {
void N() {};
};
- void (Qualifiers::*X)() = &Dummy::N; // expected-error{{cannot initialize a variable of type 'void (test1::Qualifiers::*)()' with an rvalue of type 'void (test1::Dummy::*)()': different classes ('test1::Qualifiers' vs 'test1::Dummy')}}
+ void (Qualifiers::*X)() = &Dummy::N; // expected-error-re{{cannot initialize a variable of type 'void (test1::Qualifiers::*)(){{.*}}' with an rvalue of type 'void (test1::Dummy::*)(){{.*}}': different classes ('test1::Qualifiers' vs 'test1::Dummy')}}
}
template <typename T> class PR16561 {
// Function pointers.
f fp2 = const_cast<f>(fp1); // expected-error {{const_cast to 'f' (aka 'int (*)(int)'), which is not a reference, pointer-to-object, or pointer-to-data-member}}
void (A::*mfn)() = 0;
- (void)const_cast<void (A::*)()>(mfn); // expected-error {{const_cast to 'void (A::*)()', which is not a reference, pointer-to-object, or pointer-to-data-member}}
+ (void)const_cast<void (A::*)()>(mfn); // expected-error-re {{const_cast to 'void (A::*)(){{.*}}', which is not a reference, pointer-to-object, or pointer-to-data-member}}
(void)const_cast<int&&>(0); // expected-error {{const_cast from rvalue to reference type 'int &&'}} expected-warning {{C++11}}
return **var3;
}
void (structure::*psf)() = 0;
(void)(int (structure::*)())(psf);
- (void)(void (structure::*)())(psi); // expected-error {{C-style cast from 'const int structure::*' to 'void (structure::*)()' is not allowed}}
- (void)(int structure::*)(psf); // expected-error {{C-style cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
+ (void)(void (structure::*)())(psi); // expected-error-re {{C-style cast from 'const int structure::*' to 'void (structure::*)(){{.*}}' is not allowed}}
+ (void)(int structure::*)(psf); // expected-error-re {{C-style cast from 'void (structure::*)(){{.*}}' to 'int structure::*' is not allowed}}
}
(void)structureimfp(psf);
typedef void (structure::*structurevmfp)();
- (void)structurevmfp(psi); // expected-error {{functional-style cast from 'const int structure::*' to 'structurevmfp' (aka 'void (structure::*)()') is not allowed}}
- (void)structureimp(psf); // expected-error {{functional-style cast from 'void (structure::*)()' to 'structureimp' (aka 'int structure::*') is not allowed}}
+ (void)structurevmfp(psi); // expected-error-re {{functional-style cast from 'const int structure::*' to 'structurevmfp' (aka 'void (structure::*)(){{.*}}') is not allowed}}
+ (void)structureimp(psf); // expected-error-re {{functional-style cast from 'void (structure::*)(){{.*}}' to 'structureimp' (aka 'int structure::*') is not allowed}}
}
// ---------------- misc ------------------
void (structure::*psf)() = 0;
(void)reinterpret_cast<int (structure::*)()>(psf);
- (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error {{reinterpret_cast from 'const int structure::*' to 'void (structure::*)()' is not allowed}}
- (void)reinterpret_cast<int structure::*>(psf); // expected-error {{reinterpret_cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
+ (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error-re {{reinterpret_cast from 'const int structure::*' to 'void (structure::*)(){{.*}}' is not allowed}}
+ (void)reinterpret_cast<int structure::*>(psf); // expected-error-re {{reinterpret_cast from 'void (structure::*)(){{.*}}' to 'int structure::*' is not allowed}}
// Cannot cast from integers to member pointers, not even the null pointer
// literal.
- (void)reinterpret_cast<void (structure::*)()>(0); // expected-error {{reinterpret_cast from 'int' to 'void (structure::*)()' is not allowed}}
+ (void)reinterpret_cast<void (structure::*)()>(0); // expected-error-re {{reinterpret_cast from 'int' to 'void (structure::*)(){{.*}}' is not allowed}}
(void)reinterpret_cast<int structure::*>(0); // expected-error {{reinterpret_cast from 'int' to 'int structure::*' is not allowed}}
}
(void)static_cast<void (A::*)()>(&B::f);
(void)static_cast<void (B::*)()>(&B::f);
(void)static_cast<void (C::*)()>(&B::f);
- (void)static_cast<void (D::*)()>(&B::f); // expected-error{{address of overloaded function 'f' cannot be static_cast to type 'void (PR6072::D::*)()'}}
+ (void)static_cast<void (D::*)()>(&B::f); // expected-error-re{{address of overloaded function 'f' cannot be static_cast to type 'void (PR6072::D::*)(){{.*}}'}}
}
}
}
T* f0(T*, T*) { return T(); } // expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}}
- template <typename U> T f0(T, U) { return T(); } // expected-note {{candidate template ignored: could not match 'int (int, U)' against 'int (int) const'}} \
+ template <typename U> T f0(T, U) { return T(); } // expected-note-re {{candidate template ignored: could not match 'int (int, U){{.*}}' against 'int (int) {{.*}}const'}} \
// expected-note {{candidate template ignored: could not match 'int' against 'int *'}}
};
namespace SameSignatureAfterInstantiation {
template<typename T> struct S {
void f(T *); // expected-note {{previous}}
- void f(const T*); // expected-error {{multiple overloads of 'f' instantiate to the same signature 'void (const int *)'}}
+ void f(const T*); // expected-error-re {{multiple overloads of 'f' instantiate to the same signature 'void (const int *){{.*}}'}}
};
S<const int> s; // expected-note {{instantiation}}
}
template<int (Z::*pmf)(int)> struct A6; // expected-note{{template parameter is declared here}}
A6<&Z::foo> *a17_1;
A6<&Z::bar> *a17_2;
-A6<&Z::baz> *a17_3; // expected-error{{non-type template argument of type 'double (Z::*)(double)' cannot be converted to a value of type 'int (Z::*)(int)'}}
+A6<&Z::baz> *a17_3; // expected-error-re{{non-type template argument of type 'double (Z::*)(double){{.*}}' cannot be converted to a value of type 'int (Z::*)(int){{.*}}'}}
template<int Z::*pm> struct A7; // expected-note{{template parameter is declared here}}