MicrosoftCompatibility.cpp [plain text]
typedef unsigned short char16_t;
typedef unsigned int char32_t;
typename decltype(3) a;
namespace ms_conversion_rules {
void f(float a);
void f(int a);
void test()
{
long a = 0;
f((long)0);
f(a);
}
}
namespace ms_protected_scope {
struct C { C(); };
int jump_over_variable_init(bool b) {
if (b)
goto foo; C c; foo:
return 1;
}
struct Y {
~Y();
};
void jump_over_var_with_dtor() {
goto end; Y y; end:
;
}
void jump_over_variable_case(int c) {
switch (c) {
case 0:
int x = 56; case 1: x = 10;
}
}
void exception_jump() {
goto l2; try { l2: ;
} catch(int) {
}
}
int jump_over_indirect_goto() {
static void *ps[] = { &&a0 };
goto *&&a0; int a = 3; a0:
return 0;
}
}
namespace PR11826 {
struct pair {
pair(int v) { }
void operator=(pair&& rhs) { }
};
void f() {
pair p0(3);
pair p = p0;
}
}
namespace PR11826_for_symmetry {
struct pair {
pair(int v) { }
pair(pair&& rhs) { }
};
void f() {
pair p0(3);
pair p(4);
p = p0;
}
}
namespace ms_using_declaration_bug {
class A {
public:
int f();
};
class B : public A {
private:
using A::f;
};
class C : public B {
private:
using B::f; };
}
namespace MissingTypename {
template<class T> class A {
public:
typedef int TYPE;
};
template<class T> class B {
public:
typedef int TYPE;
};
template<class T, class U>
class C : private A<T>, public B<U> {
public:
typedef A<T> Base1;
typedef B<U> Base2;
typedef A<U> Base3;
A<T>::TYPE a1; Base1::TYPE a2;
B<U>::TYPE a3; Base2::TYPE a4;
A<U>::TYPE a5; Base3::TYPE a6; };
class D {
public:
typedef int Type;
};
template <class T>
void function_missing_typename(const T::Type param){
const T::Type var = 2; }
template void function_missing_typename<D>(const D::Type param);
}
enum ENUM2 {
ENUM2_a = (enum ENUM2) 4,
ENUM2_b = 0x9FFFFFFF, ENUM2_c = 0x100000000 };
namespace PR11791 {
template<class _Ty>
void del(_Ty *_Ptr) {
_Ptr->~_Ty(); }
void f() {
int* a = 0;
del((void*)a); }
}