[LLVMbugs] [Bug 15371] Behavior of "using" statement with template inheritance does not work as expected and differs from gcc.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 27 00:08:35 PST 2013


Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
This code is ill-formed, but a compiler is not required to issue a diagnostic
for it, so both compilers are correct.

For a redeclaration of a function template, the rule is that dependent portions
of the type must be 'equivalent' (that is, composed of the same sequence of
tokens interpreted the same way). In your case, the return type of the function
definition is 'functionally equivalent' to the return type of the declaration
(that is, it will always resolve to the same type) but is not equivalent, and
that makes your code ill-formed.

So, the -DPACIFY_CLANG code is correct. The -DPACIFY_CLANG_ANGER_GCC code is
ill-formed, for the same reason the original code is ill-formed, but in that
case, it's Clang which doesn't issue a diagnostic (as before, a compiler is not
required to diagnose this).

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/20130227/8eca7c36/attachment.html>

More information about the llvm-bugs mailing list