summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/dependent-names.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-names.cpp b/clang/test/SemaTemplate/dependent-names.cpp
index 5a25030803e..011e073a727 100644
--- a/clang/test/SemaTemplate/dependent-names.cpp
+++ b/clang/test/SemaTemplate/dependent-names.cpp
@@ -399,3 +399,18 @@ namespace OperatorNew {
using size_t = decltype(sizeof(0));
void *operator new(size_t, OperatorNew::X); // expected-note-re {{should be declared prior to the call site{{$}}}}
template void OperatorNew::f(OperatorNew::X); // expected-note {{instantiation of}}
+
+namespace PR19936 {
+ template<typename T> decltype(*T()) f() {} // expected-note {{previous}}
+ template<typename T> decltype(T() * T()) g() {} // expected-note {{previous}}
+
+ // Create some overloaded operators so we build an overload operator call
+ // instead of a builtin operator call for the dependent expression.
+ enum E {};
+ int operator*(E);
+ int operator*(E, E);
+
+ // Check that they still profile the same.
+ template<typename T> decltype(*T()) f() {} // expected-error {{redefinition}}
+ template<typename T> decltype(T() * T()) g() {} // expected-error {{redefinition}}
+}
OpenPOWER on IntegriCloud