From b1406c522357e2616f1a78b3e83ea2a2bc4226f3 Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Fri, 28 Apr 2017 22:03:28 +0000 Subject: [PATCH] [ODRHash] Add testcase with different paramter names. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301701 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Modules/odr_hash.cpp | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/test/Modules/odr_hash.cpp b/test/Modules/odr_hash.cpp index 2ec8005ce5..e57c36f386 100644 --- a/test/Modules/odr_hash.cpp +++ b/test/Modules/odr_hash.cpp @@ -887,6 +887,52 @@ Bravo golf; #endif } +namespace DifferentParameterNameInTemplate { +#if defined(FIRST) || defined(SECOND) +template +struct S { + typedef T Type; + + static void Run(const Type *name_one); +}; + +template +void S::Run(const T *name_two) {} + +template +struct Foo { + ~Foo() { Handler::Run(nullptr); } + Foo() {} + + class Handler : public S {}; + + 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 betas; +}; + +#elif defined(SECOND) +struct Beta {}; + +struct BetaHelper { + void add_Beta() { betas.Add(); } + Foo betas; +}; + +#else +Alpha::Alpha() {} +#endif +} + // Keep macros contained to one file. #ifdef FIRST #undef FIRST -- 2.50.1