[LLVMbugs] [Bug 15559] New: [QOI] complain about declaration that changes meaning

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 21 01:41:08 PDT 2013


            Bug ID: 15559
           Summary: [QOI] complain about declaration that changes meaning
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zeratul976 at hotmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the following code:

struct foo {};

struct A
    typedef foo foo_type;

    void foo();

GCC gives a compiler error:

test.cpp:7:14: error: declaration of 'void A::foo()' [-fpermissive]
     void foo();
test.cpp:1:8: error: changes meaning of 'foo' from 'struct foo' [-fpermissive]
 struct foo {};

Clang gives no error. I believe this is covered by section 3.3.7 of the

"A name N used in a class S shall refer to the same declaration in its context
and when re-evaluated in the completed scope of S. No diagnostic is required
for a violation of this rule."

I am filing this as a quality-of-implementation issue. While no diagnostic is
required, I think it would be a good idea for clang to issue one, seeing as GCC

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/20130321/6cb57841/attachment.html>

More information about the llvm-bugs mailing list