Skip to content

modernize-use-using only works for trivial typedefs #38677

@steveire

Description

@steveire
Bugzilla Link 39329
Version unspecified
OS Windows NT
CC @EugeneZelenko,@mloskot

Extended Description

Here are some constructs it choked on for me:

template<bool COND, typename IF_TRUE, typename IF_FALSE, typename OTHER>
struct If
{
typedef OTHER Type;
};

template<typename IF_TRUE, typename IF_FALSE, typename OTHER>
struct If<true, IF_TRUE, IF_FALSE, OTHER>
{
typedef IF_TRUE Type;
};

template<typename IF_TRUE, typename IF_FALSE, typename OTHER>
struct If<false, IF_TRUE, IF_FALSE, OTHER>
{
typedef IF_FALSE Type;
};

If<true, int, double, float> ifstruct_true;

#define DEF_FOO __cdecl

struct A
{
template
struct B
{
typedef void ( DEF_FOO T::*type)();
};
};

namespace NS
{
typedef bool (DEF_FOO *Func)();
}

template <typename T, typename U>
class Templ
{
public:
typedef Templ<T, int> Temp;
};

Templ<double, int> tdi;

class NonTemplate
{
typedef Templ<int, int> Heap;
};

template
struct Outer
{
template
struct Inner
{
using Type = U;
};
};

template
struct TemplateKeyword
{
typedef typename U::template Inner::Type Type;
};

typedef bool TopFunc();

template
struct VarTempl;

template
struct Container
{

};

template<typename... Args>
struct VarTempl<bool(Container...)>
{
typedef bool Func(Container...);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions