Mercurial > hg > CbC > CbC_llvm
view clang/test/SemaTemplate/lookup-dependent-bases.cpp @ 266:00f31e85ec16 default tip
Added tag current for changeset 31d058e83c98
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 14 Oct 2023 10:13:55 +0900 |
parents | 1d019706d866 |
children |
line wrap: on
line source
// 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. }