r301701 - [ODRHash] Add testcase with different paramter names. NFC
Richard Trieu via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 28 15:03:28 PDT 2017
Author: rtrieu
Date: Fri Apr 28 17:03:28 2017
New Revision: 301701
URL: http://llvm.org/viewvc/llvm-project?rev=301701&view=rev
Log:
[ODRHash] Add testcase with different paramter names. NFC
Modified:
cfe/trunk/test/Modules/odr_hash.cpp
Modified: cfe/trunk/test/Modules/odr_hash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/odr_hash.cpp?rev=301701&r1=301700&r2=301701&view=diff
==============================================================================
--- cfe/trunk/test/Modules/odr_hash.cpp (original)
+++ cfe/trunk/test/Modules/odr_hash.cpp Fri Apr 28 17:03:28 2017
@@ -887,6 +887,52 @@ Bravo<char> golf;
#endif
}
+namespace DifferentParameterNameInTemplate {
+#if defined(FIRST) || defined(SECOND)
+template <typename T>
+struct S {
+ typedef T Type;
+
+ static void Run(const Type *name_one);
+};
+
+template <typename T>
+void S<T>::Run(const T *name_two) {}
+
+template <typename T>
+struct Foo {
+ ~Foo() { Handler::Run(nullptr); }
+ Foo() {}
+
+ class Handler : public S<T> {};
+
+ void Get(typename Handler::Type *x = nullptr) {}
+ void Add() { Handler::Run(nullptr); }
+};
+#endif
+
+#if defined(FIRST)
+struct Beta;
+
+struct Alpha {
+ Alpha();
+ void Go() { betas.Get(); }
+ Foo<Beta> betas;
+};
+
+#elif defined(SECOND)
+struct Beta {};
+
+struct BetaHelper {
+ void add_Beta() { betas.Add(); }
+ Foo<Beta> betas;
+};
+
+#else
+Alpha::Alpha() {}
+#endif
+}
+
// Keep macros contained to one file.
#ifdef FIRST
#undef FIRST
More information about the cfe-commits
mailing list