summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-06-22 19:50:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-06-22 19:50:19 +0000
commit69bc9aa22f22ff3dd8c649a7f6bedbe706410c4c (patch)
tree018492a86c0c4302620769fc200152b5cc83785c /clang/test
parent5421b378931813500392228d432980b71e33ce66 (diff)
downloadbcm5719-llvm-69bc9aa22f22ff3dd8c649a7f6bedbe706410c4c.tar.gz
bcm5719-llvm-69bc9aa22f22ff3dd8c649a7f6bedbe706410c4c.zip
Restore pre-r335182 behavior for naming inherited constructors as
members of dependent contexts. This permits cases where the names before and after the '::' in a dependent inherited constructor using-declaration do not match, but where we can nonetheless tell when parsing the template that a constructor is being named. Under (open) core language DR 2070, such cases will probably be ill-formed, but r335182 does not quite give that result and didn't intend to change this, so restore the old behavior for now. llvm-svn: 335381
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp b/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp
index cf58a85d849..73e0369e608 100644
--- a/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp
+++ b/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp
@@ -199,5 +199,20 @@ namespace InhCtor {
using T::T; // expected-error {{type 'int' cannot be used prior to '::' because it has no members}}
};
UsingIntTemplate<int> uit; // expected-note {{here}}
+
+ // This case is odd: we don't name the constructor of a dependent base as
+ // Base::Base, but we still happen to have enough information to identify
+ // when parsing the template that we're inheriting constructors.
+ //
+ // FIXME: Once CWG 2070 is resolved, check whether this case should be
+ // accepted or not.
+ namespace DependentCtorName {
+ template <typename T> struct B { B(int); };
+ template <typename T> struct A : B<T> {
+ using X = B<T>;
+ using X::B;
+ };
+ A<int> ab = 0;
+ }
#endif
}
OpenPOWER on IntegriCloud