[llvm-bugs] [Bug 47435] New: Missing diagnostic when using dependent base class via template alias with dummy parameter.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 6 01:32:00 PDT 2020


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

            Bug ID: 47435
           Summary: Missing diagnostic when using dependent base class via
                    template alias with dummy parameter.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anders.granlund.0 at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Consider the following c++ program:

  class A
  {
      protected:
          int x;
  };

  template<typename X>
  using B = A;

  template<typename T>
  class C : public B<T>
  {
      public:
          void f()
          {
              x = 0;
          }
  };

  int main()
  {
  }

Compile it with "-std=c++17 -pedantic-errors".

Since the base class is dependent the name lookup of x should fail and an error
message should be outputed during compilation, but no error message was
outputed. Note that gcc correctly outputs an error message.

-- 
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/20200906/d3a446ec/attachment.html>


More information about the llvm-bugs mailing list