diff options
| author | Richard Trieu <rtrieu@google.com> | 2017-04-28 22:03:28 +0000 |
|---|---|---|
| committer | Richard Trieu <rtrieu@google.com> | 2017-04-28 22:03:28 +0000 |
| commit | 157ed94ee72b5e21e0a310491d6b807511d72f6b (patch) | |
| tree | 68c9e8dca50e26447e1e8bc83a85625ebbafb7f1 | |
| parent | 072ddb383c816fe71ae77a5cbbcd2f597ad9abe1 (diff) | |
| download | bcm5719-llvm-157ed94ee72b5e21e0a310491d6b807511d72f6b.tar.gz bcm5719-llvm-157ed94ee72b5e21e0a310491d6b807511d72f6b.zip | |
[ODRHash] Add testcase with different paramter names. NFC
llvm-svn: 301701
| -rw-r--r-- | clang/test/Modules/odr_hash.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/clang/test/Modules/odr_hash.cpp b/clang/test/Modules/odr_hash.cpp index 2ec8005ce50..e57c36f3864 100644 --- a/clang/test/Modules/odr_hash.cpp +++ b/clang/test/Modules/odr_hash.cpp @@ -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 |

