summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-10-10 14:26:40 +0000
committerEric Fiselier <eric@efcs.ca>2016-10-10 14:26:40 +0000
commit7ae80c6396a6095f5a57df67b4282ec66724e6cc (patch)
treeafc09ecf7ad02d8d729859599db6f6620950c6e8 /clang/test
parentea99ff719bd458f69ad9c2d2f59396950937b8db (diff)
downloadbcm5719-llvm-7ae80c6396a6095f5a57df67b4282ec66724e6cc.tar.gz
bcm5719-llvm-7ae80c6396a6095f5a57df67b4282ec66724e6cc.zip
[Sema] Prevent using member declaration diagnostic if the base class is invalid.
Summary: Once a base class has been made invalid (by a static_assert for example) all using-member declarations in the derived classes will result in a "not a base class" diagnostic. This diagnostic is very misleading and should not be emitted. This change is needed to help libc++ produce reasonable diagnostics in `std::optional` and `std::variant`. Reviewers: rsmith, majnemer, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25430 llvm-svn: 283755
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/using-decl-templates.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/using-decl-templates.cpp b/clang/test/SemaCXX/using-decl-templates.cpp
index d766bb3ac6b..3b2b8e15c83 100644
--- a/clang/test/SemaCXX/using-decl-templates.cpp
+++ b/clang/test/SemaCXX/using-decl-templates.cpp
@@ -92,3 +92,12 @@ namespace aliastemplateinst {
template struct APtr<int>; // expected-error{{elaborated type refers to a type alias template}}
}
+
+namespace DontDiagnoseInvalidTest {
+template <bool Value> struct Base {
+ static_assert(Value, ""); // expected-error {{static_assert failed}}
+};
+struct Derived : Base<false> { // expected-note {{requested here}}
+ using Base<false>::Base; // OK. Don't diagnose that 'Base' isn't a base class of Derived.
+};
+} // namespace DontDiagnoseInvalidTest
OpenPOWER on IntegriCloud