[llvm-bugs] [Bug 46214] New: Clang can not compile typename with non-type in using declaration

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 5 05:28:00 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46214

            Bug ID: 46214
           Summary: Clang can not compile typename with non-type in using
                    declaration
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

cat test.cc

namespace g_namespace {
    int var = 9;
    typedef int C; 
}
int main() {
  using typename g_namespace::var; //fails
  using typename g_namespace::C; //ok
  return 0;
}

$clang++-trunk test.cc
<source>:6:31: error: 'typename' keyword used on a non-type
  using typename g_namespace::var; //fails
                              ^
<source>:2:9: note: target of using declaration
    int var = 9;
        ^
1 error generated.
Execution build compiler returned: 1

Reproduced in godbolt: https://godbolt.org/z/MgR7GF

In GCC, test.cc is compiled well.

I am wondering that is it Clang still not support this feature that
using-declaration with a non-type typename or this is a bug in clang?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200605/d9282beb/attachment.html>


More information about the llvm-bugs mailing list