diff options
Diffstat (limited to 'clang-tools-extra/test/cpp11-migrate/ReplaceAutoPtr/template_fail.cpp')
-rw-r--r-- | clang-tools-extra/test/cpp11-migrate/ReplaceAutoPtr/template_fail.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/clang-tools-extra/test/cpp11-migrate/ReplaceAutoPtr/template_fail.cpp b/clang-tools-extra/test/cpp11-migrate/ReplaceAutoPtr/template_fail.cpp new file mode 100644 index 00000000000..cdbf272c26b --- /dev/null +++ b/clang-tools-extra/test/cpp11-migrate/ReplaceAutoPtr/template_fail.cpp @@ -0,0 +1,31 @@ +// XFAIL: * +// +// Without inline namespace: +// +// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp +// RUN: cpp11-migrate -replace-auto_ptr %t.cpp -- -I %S/Inputs std=c++11 +// RUN: FileCheck -input-file=%t.cpp %s +// +// With inline namespace: +// +// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp +// RUN: cpp11-migrate -replace-auto_ptr %t.cpp -- -I %S/Inputs std=c++11 \ +// RUN: -DUSE_INLINE_NAMESPACE=1 +// RUN: FileCheck -input-file=%t.cpp %s + +#include "memory_stub.h" + +// Fail to modify when the template is never instantiated. +// +// This might not be an issue. If it's never used it doesn't really matter if +// it's changed or not. If it's a header and one of the source use it, then it +// will still be changed. +template <typename X> +void f() { + std::auto_ptr<X> p; + // CHECK: std::unique_ptr<X> p; +} + +// Alias template could be replaced if a matcher existed. +template <typename T> using aaaaaaaa = auto_ptr<T>; +// CHECK: template <typename T> using aaaaaaaa = unique_ptr<T>; |