[LLVMbugs] [Bug 24138] New: Compiler accepting ill-formed program trying to define a struct via using-declaration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 15 14:19:16 PDT 2015


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

            Bug ID: 24138
           Summary: Compiler accepting ill-formed program trying to define
                    a struct via using-declaration
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anders.granlund.0 at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider the following program:

  namespace R {
      struct f;
  }

  namespace S {
      using R::f;
  }
  struct S::f {};

  int main() {}

But clang compiles it without any error messages. The expected behaviour is to
get an error message.

The program is ill-formed by the following clauses in the c++ standard:

* [class]p11 ( http://eel.is/c++draft/class#11 ):
Note especially the sentence "i.e., not merely inherited or introduced by a
using-declaration"

* [dcl.meaning]p1 ( http://eel.is/c++draft/dcl.meaning#1 ):
Not especially the sentence "the member shall not merely have been introduced
by a using-declaration in the scope of the class or namespace nominated by the
nested-name-specifier of the declarator-id."

-- 
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/20150715/a1465231/attachment.html>


More information about the llvm-bugs mailing list