phunix/external/bsd/llvm/dist/clang/test/SemaTemplate/lookup-dependent-bases.cpp
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

56 lines
1.3 KiB
C++

// RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s
namespace basic {
struct C {
static void foo2() {}
};
template <typename T>
struct A {
typedef C D;
};
template <typename T>
struct B : A<T> {
void foo() {
D::foo2(); // expected-warning {{use of undeclared identifier 'D'; unqualified lookup into dependent bases of class template 'B' is a Microsoft extension}}
}
};
template struct B<int>; // Instantiation has no warnings.
}
namespace nested_nodep_base {
// There are limits to our hacks, MSVC accepts this, but we don't.
struct A {
struct D { static void foo2(); };
};
template <typename T>
struct B : T {
struct C {
void foo() {
D::foo2(); // expected-error {{use of undeclared identifier 'D'}}
}
};
};
template struct B<A>; // Instantiation has no warnings.
}
namespace nested_dep_base {
// We actually accept this because the inner class has a dependent base even
// though it isn't a template.
struct A {
struct D { static void foo2(); };
};
template <typename T>
struct B {
struct C : T {
void foo() {
D::foo2(); // expected-warning {{use of undeclared identifier 'D'; unqualified lookup into dependent bases of class template 'C' is a Microsoft extension}}
}
};
};
template struct B<A>; // Instantiation has no warnings.
}