summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-06-05 22:43:40 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-06-05 22:43:40 +0000
commitf15acc5f5cb36c60d9c20cf9dc58d0408cec1264 (patch)
tree0d388aef5fb535544c870992e98cd0b18c99003d /clang/test
parent84ea12b5dc0a21698aa8ea2d3768c4b321625c65 (diff)
downloadbcm5719-llvm-f15acc5f5cb36c60d9c20cf9dc58d0408cec1264.tar.gz
bcm5719-llvm-f15acc5f5cb36c60d9c20cf9dc58d0408cec1264.zip
PR19936: Fix a really dumb bug where we would profile dependent operator* expressions incorrectly.
llvm-svn: 210296
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