namespace PR21817{
int a(-rsing[2]); }
struct errc {
int v_;
operator int() const {return v_;}
};
class error_condition
{
int _val_;
public:
error_condition() : _val_(0) {}
error_condition(int _val)
: _val_(_val) {}
template <class E>
error_condition(E _e) {
*this = make_error_condition(_e);
}
};
inline error_condition make_error_condition(errc _e) {
return error_condition(static_cast<int>(_e));
}
struct BaseType { };
struct Derived : public BaseType { static int base_type; Derived() : basetype() {} };
int get_type(struct Derived *st) {
return st->Base_Type; }
class some_name {}; somename Foo; namespace SomeName {} using namespace somename;
struct st {
struct {
int field1;
};
double FieldA; };
st var = { .fielda = 0.0 };
typedef char* another_str; namespace AnotherStd { class string {};
}
another_std::string str; another_str *cstr = new AnotherStr;
char* TireNames;
template<typename ...TypeNames> struct count { static const unsigned value = sizeof...(TyreNames); };
namespace unknown_type_test {
class StreamOut {}; long stream_count; };
unknown_type_test::stream_out out;
namespace cache_invalidation_test {
using namespace unknown_type_test;
void bar(long i);
void before_caching_classname() {
bar((stream_out)); }
stream_out out; void after_caching_classname() {
bar((stream_out)); }
}
struct BaseDecl {
void add_in(int i);
};
struct TestRedecl : public BaseDecl {
void add_it(int i); };
void TestRedecl::add_in(int i) {}
class SomeNetMessage; class Message {};
void foo(Message&);
void foo(SomeNetMessage&);
void doit(void *data) {
Message somenetmsg; foo(somenetmessage); foo((somenetmessage)data); }
void revoke(const char*); void Test() {
Invoke(); Invoke("foo"); Invoke("foo", "bar"); }
void Test2(void (*invoke)(const char *, int)) { Invoke(); Invoke("foo"); Invoke("foo", 7); Invoke("foo", 7, 22); }
void provoke(const char *x, bool y=false) {} void Test3() {
Provoke(); Provoke("foo"); Provoke("foo", true); Provoke("foo", 7, 22); }
struct R {};
bool begun(R);
void RangeTest() {
for (auto b : R()) {} }
class Parent {
void set_types(int index, int value);
void add_types(int value);
};
class Child: public Parent {};
void Child::add_types(int value) {}
namespace clash {
class ConstructExpr {}; }
class ClashTool {
bool HaveConstructExpr();
template <class T> T* getExprAs();
void test() {
ConstructExpr *expr = getExprAs<ConstructExpr>(); }
};
namespace test1 {
struct S {
struct Foobar *f; };
test1::FooBar *b; }
namespace ImplicitInt {
void f(int, unsinged); struct S {
unsinged : 4; };
}
namespace PR13051 {
template<typename T> struct S {
template<typename U> void f();
operator bool() const;
};
void foo(); void g(void(*)()); void g(bool(S<int>::*)() const);
void test() {
g(&S<int>::tempalte f<int>); g(&S<int>::opeartor bool); g(&S<int>::foo); }
}
inf f(doulbe);
namespace PR6325 {
class foo { }; class bar : boo { }; }
namespace outer {
void somefunc(); void somefunc(int, int);
namespace inner {
void somefunc(int) {
someFunc(); someFunc(1, 2); }
}
}
namespace b6956809_test1 {
struct A {};
struct B {};
struct S1 {
void method(A*); void method(B*); };
void test1() {
B b;
S1 s;
s.methodd(&b); }
struct S2 {
S2();
void method(A*) const;
private:
void method(B*);
};
void test2() {
B b;
const S2 s;
s.methodd(&b); }
}
namespace b6956809_test2 {
template<typename T> struct Err { typename T::error n; }; struct S {
template<typename T> typename Err<T>::type method(T); template<typename T> int method(T *); };
void test() {
S s;
int k = s.methodd((void*)0); }
}
namespace PR12951 {
namespace foobar { struct Thing {}; }
namespace bazquux { struct Thing {}; }
void f() { Thing t; } }
namespace bogus_keyword_suggestion {
void test() {
status = "OK"; return status; }
}
namespace PR13387 {
struct A {
void CreateFoo(float, float);
void CreateBar(float, float);
};
struct B : A {
using A::CreateFoo; void CreateFoo(int, int); };
void f(B &x) {
x.Createfoo(0,0); x.Createfoo(0.f,0.f); }
}
namespace using_decl {
namespace somewhere { int foobar; }
using somewhere::foobar; int k = goobar; }
struct DataStruct {void foo();};
struct T {
DataStruct data_struct;
void f();
};
void f() {
data_struct->foo(); }
namespace PR12287 {
class zif {
void nab(int);
};
void nab(); void zif::nab(int) {
nab(); }
}
namespace TemplateFunction {
template <class T>
void fnA(T) { }
template <class T>
void fnB(T) { }
class Foo {
public:
void fnA(int, int) {}
void fnB() {}
};
void test(Foo F, int num) {
F.fnA(num); F.fnB(num); }
}
namespace using_suggestion_val_dropped_specifier {
void FFF() {} namespace N { }
using N::FFF; }
namespace class_member_typo_corrections {
class Outer {
public:
class Inner {}; Inner MyMethod(Inner arg);
};
Inner Outer::MyMethod(Inner arg) { return Inner();
}
class Result {
public:
enum ResultType {
ENTITY, PREDICATE, LITERAL };
ResultType type();
};
void test() {
Result result_cell;
switch (result_cell.type()) {
case ENTITY: case LITERAL: case PREDICAT: break;
}
}
class Figure {
enum ResultType {
SQUARE,
TRIANGLE,
CIRCLE
};
public:
ResultType type();
};
void testAccess() {
Figure obj;
switch (obj.type()) {
case SQUARE: case TRIANGLE: case CIRCE: break;
}
}
}
long readline(const char *, char *, unsigned long);
void assign_to_unknown_var() {
deadline_ = 1; }
namespace no_ns_before_dot {
namespace re2 {}
void test() {
req.set_check(false); }
}
namespace PR17394 {
class A {
protected:
long zzzzzzzzzz;
};
class B : private A {};
B zzzzzzzzzy<>; }
namespace correct_fields_in_member_funcs {
struct S {
int my_member; void f() { my_menber = 1; } };
}
namespace PR17019 {
template<class F>
struct evil {
evil(F de) { de_; }
~evil() {
de_->bar() }
};
void meow() {
evil<int> Q(0); }
}
namespace fix_class_name_qualifier {
class MessageHeaders {};
class MessageUtils {
public:
static void ParseMessageHeaders(int, int); };
void test() {
MessageHeaders::ParseMessageHeaders(5, 4); }
}
namespace PR18213 { struct WrapperInfo {
int i;
};
template <typename T> struct Wrappable {
static WrapperInfo kWrapperInfo;
};
template <>
PR18213::WrapperInfo ::PR18213::Wrappable<int>::kWrapperInfo = { 0 }; }
namespace PR18651 {
struct {
int x;
} a, b;
int y = x; }
namespace PR18685 {
template <class C, int I, int J>
class SetVector {
public:
SetVector() {}
};
template <class C, int I>
class SmallSetVector : public SetVector<C, I, 8> {};
class foo {};
SmallSetVector<foo*, 2> fooSet;
}
PR18685::BitVector Map;
namespace shadowed_template {
template <typename T> class Fizbin {}; class Baz {
int Fizbin;
Fizbin<int> qux; };
}
namespace no_correct_template_id_to_non_template {
struct Frobnatz {}; Frobnats fn; Frobnats<int> fni; }
namespace PR18852 {
void func() {
struct foo {
void barberry() {}
};
barberry(); }
class Thread {
public:
void Start();
static void Stop(); };
class Manager {
public:
void Start(int); void Stop(int); };
void test(Manager *m) {
m->Start(); m->Stop(); Stop(); }
}
namespace std {
class bernoulli_distribution {
public:
double p() const;
};
}
void test() {
if (p) return;
}
namespace PR19681 {
struct TypoA {};
struct TypoB {
void test();
private:
template<typename T> void private_memfn(T); };
void TypoB::test() {
(void)static_cast<void(TypoB::*)(int)>(&TypoA::private_memfn); }
}
namespace testWantFunctionLikeCasts {
long test(bool a) {
if (a)
return struc(5.7); else
return lon(8.0); }
}
namespace testCXXDeclarationSpecifierParsing {
namespace test {
struct SomeSettings {}; }
class Test {};
int bar() {
Test::SomeSettings some_settings; }
}
namespace testIncludeTypeInTemplateArgument {
template <typename T, typename U>
void foo(T t = {}, U = {});
class AddObservation {}; int bar1() {
foo<AddObservationFn, int>();
foo(AddObservationFn, 1); int a = AddObservationFn, b;
int AddObservation; foo(AddObservationFn, 1); int c = AddObservationFn, d;
foo<AddObservationFn, int>(); }
}
namespace testNoCrashOnNullNNSTypoCorrection {
int AddObservation();
template <typename T, typename... Args>
class UsingImpl {};
class AddObservation { using Using =
UsingImpl<AddObservationFn, const int>; };
}
namespace testNonStaticMemberHandling {
struct Foo {
bool usesMetadata; };
int test(Foo f) {
if (UsesMetadata) return 5;
if (f.UsesMetadata) return 11;
return 0;
}
};
namespace testMemberExprDeclarationNameInfo {
void f(int);
struct S {
int data; void m_fn1() {
data_ [] = f(data_); }
};
}
namespace testArraySubscriptIndex {
struct S {
int data; void m_fn1() {
(+)[data_]; }
};
}
namespace crash_has_include {
int has_include(int); int foo = __has_include(42); }
namespace PR24781_using_crash {
namespace A {
namespace B {
class Foofoo {}; }
}
namespace C {
namespace D {
class Bar : public A::B::Foofoo {};
}
}
using C::D::Foofoo; }
int d = ? L : d;
struct B0 {
int : 0 | (struct B0)e; };
namespace {
struct a0is0 {};
struct b0is0 {};
int g() {
0 [
sizeof(c0is0)]; };
}
namespace avoidRedundantRedefinitionErrors {
class Class {
void function(int pid); };
void Class::function2(int pid) { }
void Class::function(int pid) { }
void Class::function(int pid) { }
namespace ns {
void create_test(); }
void ns::create_test2() { }
void ns::create_test() {
}
}
namespace PR46487 {
bool g_var_bool; const char g_volatile_char = 5; enum : decltype((g_var_long = throw))::a {
b = g_volatile_uchar };
}
namespace PR47272
{
namespace Views {
int Take(); }
namespace [[deprecated("use Views instead")]] View {
using Views::Take;
}
namespace [[deprecated]] A { int pr47272;
}
namespace B {
using A::pr47272; }
namespace [[deprecated]] C {
using A::pr47272;
}
void function() {
int x = ::Take(); int y = ::pr47272; }
}