summaryrefslogtreecommitdiff
path: root/test/SemaCXX/cxx11-crashes.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2016-11-27 16:26:14 +0000
committerHal Finkel <hfinkel@anl.gov>2016-11-27 16:26:14 +0000
commitb3eb023bef514b684fcb374ae674c251e48514fd (patch)
tree081f49940829562a6c7530ac6ee69adb638c661a /test/SemaCXX/cxx11-crashes.cpp
parentfa27a624b22fa1e25138430831305c32cc52083b (diff)
downloadclang-b3eb023bef514b684fcb374ae674c251e48514fd.tar.gz
Adjust type-trait evaluation to properly handle Using(Shadow)Decls
Since r274049, for an inheriting constructor declaration, the name of the using declaration (and using shadow declaration comes from the using declaration) is the name of a derived class, not the base class (line 8225-8232 of lib/Sema/SemaDeclCXX.cpp in https://reviews.llvm.org/rL274049). Because of this, name-based lookup performed inside Sema::LookupConstructors returns not only CXXConstructorDecls but also Using(Shadow)Decls, which results assertion failure reported in PR29087. Patch by Taewook Oh, thanks! Differential Revision: https://reviews.llvm.org/D23765 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx11-crashes.cpp')
-rw-r--r--test/SemaCXX/cxx11-crashes.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx11-crashes.cpp b/test/SemaCXX/cxx11-crashes.cpp
index 97c959454c..7c455eecd5 100644
--- a/test/SemaCXX/cxx11-crashes.cpp
+++ b/test/SemaCXX/cxx11-crashes.cpp
@@ -91,3 +91,15 @@ void test(int some_number) { // expected-note {{'some_number' declared here}}
Foo(lambda);
}
}
+
+namespace pr29091 {
+ struct X{ X(const X &x); };
+ struct Y: X { using X::X; };
+ bool foo() { return __has_nothrow_constructor(Y); }
+ bool bar() { return __has_nothrow_copy(Y); }
+
+ struct A { template <typename T> A(); };
+ struct B : A { using A::A; };
+ bool baz() { return __has_nothrow_constructor(B); }
+ bool qux() { return __has_nothrow_copy(B); }
+}