[LLVMbugs] [Bug 6989] New: Problematic using declarations

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 30 06:07:10 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=6989

           Summary: Problematic using declarations
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following problem comes from boost. Consider the following code:

template<typename T>
struct A {
  typedef int type;
};

template<typename T>
struct B : A<T> {
    using A<T>::type;

};

B<int> b;


In clang, the 'using' line must be changed to: using typename A<T>::type;

Now, I believe this is technically correct. However, with g++ version does not
accept typename, and the clang version does not work without it, meaning it is
impossible to write this code in such a way that it compiles in both g++ and
clang!

Comeau compiles both with and without the typename, in both strict and relaxed
mode.

I believe the only thing which can be placed after that 'using' is a type.
Given that, would clang consider allowing the typename to be missing? (Possibly
with a warning?)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list