diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-13 04:12:04 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-13 04:12:04 +0000 |
commit | 57e7ff9c0c442d1fe900d3496a86738d6856f482 (patch) | |
tree | 1f56fb68bcba3c1071554cd5c9453bb63a5cbf85 /clang/test/SemaTemplate/instantiate-method.cpp | |
parent | 563d03934c78d9f6e3936d1c475e3c5fb48f8b35 (diff) | |
download | bcm5719-llvm-57e7ff9c0c442d1fe900d3496a86738d6856f482.tar.gz bcm5719-llvm-57e7ff9c0c442d1fe900d3496a86738d6856f482.zip |
Provide a special-case diagnostic when two class member functions instantiate
to the same signature. Fix a bug in the type printer which would cause this
diagnostic to print wonderful types like 'const const int *'.
llvm-svn: 160161
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-method.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-method.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-method.cpp b/clang/test/SemaTemplate/instantiate-method.cpp index 363115d1844..5e9da3f688e 100644 --- a/clang/test/SemaTemplate/instantiate-method.cpp +++ b/clang/test/SemaTemplate/instantiate-method.cpp @@ -173,5 +173,12 @@ namespace PR7022 { typedef X2<> X2_type; X2_type c; } +} +namespace SameSignatureAfterInstantiation { + template<typename T> struct S { + void f(T *); // expected-note {{previous}} + void f(const T*); // expected-error {{multiple overloads of 'f' instantiate to the same signature 'void (const int *)'}} + }; + S<const int> s; // expected-note {{instantiation}} } |