Skip to content

Ambiguity between template-name and other name should be detected #18860

@kariya-mitsuru

Description

@kariya-mitsuru
Bugzilla Link 18486
Version trunk
OS All
CC @DougGregor,@zygoloid

Extended Description

I think that sample code below should cause error because TEST is ambiguous.

namespace FOO {
    template<int I>
    struct FOO {};
}
using namespace FOO;
void f() { FOO<0> x; }

However, an error does not actually occur.

If above sample is well-formed, why is next code ill-formed?

template<int I>
struct FOO {};
namespace BAR {
    namespace FOO {
        void f() { FOO<0> x; }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions