struct C1 {
virtual void f();
static void g();
};
struct C2 : virtual public virtual C1 { };
virtual void C1::f() { }
static void C1::g() { }
template<int Value> struct CT { template<typename> struct Inner; };
#if __cplusplus < 201103L
CT<10 >> 2> ct; #endif
class C3 {
public:
C3(C3, int i = 0); };
struct CT<0> { };
template<> union CT<1> { };
struct CT<2>::Inner<int> { };
class A {
protected:
int foo();
};
class B : public A {
#if __cplusplus >= 201103L
A::foo; #else
A::foo; #endif
};
void f() throw(); void f();
namespace rdar7853795 {
struct A {
bool getNumComponents() const; void dump() const {
getNumComponenets(); }
};
}
namespace rdar7796492 {
struct A { int x, y; A(); };
A::A()
: x(1) y(2) { }
}
class C {
int C::foo(); };
namespace rdar8488464 {
int x = 0;
int x1 &= 0; int x2 *= 0; int x3 += 0; int x4 -= 0; int x5 != 0; int x6 /= 0; int x7 %= 0; int x8 <= 0; int x9 <<= 0; int x10 >= 0; int x11 >>= 0; int x12 ^= 0; int x13 |= 0; int x14 == 0;
void f() {
int x = 0;
(void)x;
int x1 &= 0; (void)x1;
int x2 *= 0; (void)x2;
int x3 += 0; (void)x3;
int x4 -= 0; (void)x4;
int x5 != 0; (void)x5;
int x6 /= 0; (void)x6;
int x7 %= 0; (void)x7;
int x8 <= 0; (void)x8;
int x9 <<= 0; (void)x9;
int x10 >= 0; (void)x10;
int x11 >>= 0; (void)x11;
int x12 ^= 0; (void)x12;
int x13 |= 0; (void)x13;
int x14 == 0; (void)x14;
if (int x = 0) { (void)x; }
if (int x1 &= 0) { (void)x1; } if (int x2 *= 0) { (void)x2; } if (int x3 += 0) { (void)x3; } if (int x4 -= 0) { (void)x4; } if (int x5 != 0) { (void)x5; } if (int x6 /= 0) { (void)x6; } if (int x7 %= 0) { (void)x7; } if (int x8 <= 0) { (void)x8; } if (int x9 <<= 0) { (void)x9; } if (int x10 >= 0) { (void)x10; } if (int x11 >>= 0) { (void)x11; } if (int x12 ^= 0) { (void)x12; } if (int x13 |= 0) { (void)x13; } if (int x14 == 0) { (void)x14; } }
}
template <class A>
class F1 {
public:
template <int B>
class Iterator {
};
};
template<class T>
class F2 {
typename F1<T>:: Iterator<0> Mypos; };
template <class T>
void f(){
typename F1<T>:: Iterator<0> Mypos; }
class AD {};
class BD: public AD {};
void test (BD &br) {
AD* aPtr;
BD b;
aPtr = b; aPtr = br; }
void foo1() const {} void foo2() volatile {} void foo3() const volatile {}
struct S { void f(int, char); };
int itsAComma,
itsAComma2 = 0,
oopsAComma(42), AD oopsMoreCommas() {
static int n = 0, static char c,
&d = c, S s, s.f(n, d);
AD ad, return ad;
}
struct MoreAccidentalCommas {
int a : 5,
b : 7,
: 4, char c, double d, MoreAccidentalCommas *next, public:
int k, friend void f(MoreAccidentalCommas) {}
int k2, virtual void g(), };
template<class T> struct Mystery;
template<class T> typedef Mystery<T>::type getMysteriousThing() { return Mystery<T>::get();
}
template<template<typename> Foo, template<typename> typename Bar, template<typename> struct Baz> void func();
namespace ShadowedTagType {
class Foo {
public:
enum Bar { X, Y };
void SetBar(Bar bar);
Bar Bar(); private:
Bar bar_; };
void Foo::SetBar(Bar bar) { bar_ = bar; } }
#define NULL __null
char c = NULL; double dbl = NULL;
namespace arrow_suggest {
template <typename T>
class wrapped_ptr {
public:
wrapped_ptr(T* ptr) : ptr_(ptr) {}
T* operator->() { return ptr_; }
private:
T *ptr_;
};
class Worker {
public:
void DoSomething();
};
void test() {
wrapped_ptr<Worker> worker(new Worker);
worker.DoSomething(); }
}
namespace redecl_typo {
namespace Foo {
void BeEvil(); }
namespace Bar {
namespace Foo {
bool isGood(); void beEvil();
}
}
bool Foo::isGood() { return true;
}
void Foo::beEvil() {} }
namespace greatergreater {
template<typename T> struct S { S(); S(T); };
void f(S<int>=0);
struct Shr {
template<typename T> Shr(T);
template<typename T> void operator >>=(T);
};
template<template<typename>> struct TemplateTemplateParam;
template <typename T> int t = 0;
void g() {
int p = 0;
(void)(t<int>==p); (void)(t<int>>=p); #if __cplusplus < 201103L
(void)(t<S<int>>>=p); (Shr)t<S<int>>>>=p; #endif
}
}
class foo {
static void test() {
(void)&i; }
int i();
};
namespace dtor_fixit {
struct foo {
~bar() { } };
class bar { ~bar();
};
~bar::bar() {}
namespace N {
typedef foo T;
template <typename T> struct X {};
}
void f(foo *p, N::X<int> *x) {
p->~undeclared();
p->~bar();
p->N::T::~foo();
typedef foo baz; p->dtor_fixit::foo::~baz();
x->N::X<int>::~X(); }
}
namespace PR5066 {
template<typename T> struct X {};
X<int *p> x; }
namespace PR5898 {
class A {
public:
const char *str();
};
const char* foo(A &x)
{
return x.str.(); }
bool bar(A x, const char *y) {
return foo->(x) == y; }
}
namespace PR15045 {
class Cl0 {
public:
int a;
};
int f() {
Cl0 c;
return c->a; }
}
namespace curly_after_base_clause {
struct A { void f(); };
struct B : A int i;
};
struct C : A using A::f;
};
struct D : A protected:
};
struct E : A template<typename T> struct inner { };
};
struct F : A F() { }
};
#if __cplusplus >= 201103L
struct G : A constexpr G(int) { }
};
struct H : A static_assert(true, "");
};
#endif
}
struct conversion_operator {
conversion_operator::* const operator int(); };
struct const_zero_init {
int a;
};
const const_zero_init czi; int use_czi = czi.a;
namespace dotPointerDestructor {
struct Bar {
~Bar();
};
void bar(Bar *o) {
o.~Bar(); }
}