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

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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
standard:

"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
does.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to