From 7722d0aebcba7bbe7f47d207598ac1c9296fde94 Mon Sep 17 00:00:00 2001 From: Bassem Girgis Date: Sun, 25 Apr 2021 16:54:05 -0500 Subject: [PATCH] more files --- src/{test.cpp => test001.cpp} | 0 src/test002.cpp | 61 +++++++++++++++++++++++++++++++++ src/test003.cpp | 63 +++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) rename src/{test.cpp => test001.cpp} (100%) create mode 100755 src/test002.cpp create mode 100755 src/test003.cpp diff --git a/src/test.cpp b/src/test001.cpp similarity index 100% rename from src/test.cpp rename to src/test001.cpp diff --git a/src/test002.cpp b/src/test002.cpp new file mode 100755 index 0000000..57b394c --- /dev/null +++ b/src/test002.cpp @@ -0,0 +1,61 @@ +#include + +using namespace std; + +template +class TemplateWithWarning { + public: + TemplateWithWarning(uint8_t number) { internalNumber = number; } + + TemplateWithWarning(uint8_t number, bool someFlag) + : TemplateWithWarning(number) {} + + protected: + uint32_t internalNumber; +}; + +class ClassWithWarning { + public: + ClassWithWarning(char *name) { this->initClass(name); } + + ClassWithWarning(uint8_t blarg) : ClassWithWarning("something") {} + + private: + char *name; + void initClass(char *name) { this->name = name; } +}; + +int main() { + TemplateWithWarning blarg(5, true); + cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! + return 0; +} +template +class A { + virtual void f() {} + + public: + virtual ~A() {} +}; + +template +class B : public A { + virtual void f() {} +}; + +template +void waldo() { + return 5; +} + +enum class Color { Red, Green }; + +template +class Test { + public: + // The id could be changed only for red color. + typename std::enable_if::type setId(int id) { mId = id; } + + private: + int mId = 0; +}; diff --git a/src/test003.cpp b/src/test003.cpp new file mode 100755 index 0000000..5141ed4 --- /dev/null +++ b/src/test003.cpp @@ -0,0 +1,63 @@ + +template +class TemplateWithWarning { + public: + TemplateWithWarning(int number) { internalNumber = number; } + + TemplateWithWarning(int number, bool someFlag) + : TemplateWithWarning(number) {} + + protected: + int internalNumber; +}; + +class TemplateWithWarning1 { + public: + TemplateWithWarning1(int number) { internalNumber = number; } + + TemplateWithWarning1(int number, bool someFlag) + : TemplateWithWarning1(number) {} + + protected: + int internalNumber; +}; + +class ClassWithWarning { + public: + ClassWithWarning(char *n) { this->initClass(n); } + + ClassWithWarning(int k) { initClass("hi"); } + + private: + char *name; + void initClass(char *name) { this->name = name; } +}; +import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFieldReference; + +IBinding fBinding = null; +if (fNameExp instanceof IASTIdExpression) { + IASTIdExpression fName = (IASTIdExpression)fNameExp; + fBinding = fName.getName().resolveBinding(); +} else if (fNameExp instanceof ICPPASTFieldReference) { + ICPPASTFieldReference fName = (ICPPASTFieldReference)fNameExp; + fBinding = fName.getFieldName().resolveBinding(); +} +if (fBinding != null) { + // class ClassWithWarning { + // public: + // ClassWithWarning(char* n) { + // this->initClass(n); + // } + // + // private: + // char *name; + // void initClass(char *name) { + // this->name = name; + // } + // }; + public + void testMemberFunctionCalling_519473() throws Exception { + loadCodeAndRun(getAboveComment()); + checkNoErrors(); + } +}