[llvm-bugs] [Bug 47316] New: 'error: parameter declarator cannot be qualified' on seemingly valid code

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 26 01:22:16 PDT 2020


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

            Bug ID: 47316
           Summary: 'error: parameter declarator cannot be qualified' on
                    seemingly valid code
           Product: clang
           Version: 10.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: slyfox at inbox.ru
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

Original bug is observed on https://bugs.gentoo.org/739036 where
source-highlight was buildable by g++-10 and failed b clang++-10.

Reduced example:

  namespace a {

  enum c { d };
  class e {
  public:
    e(c);
  };

  }; // namespace a
  a::e f(a::e(a::d));

gcc succeeds to build the example, clang fails:

$ g++-10.2.0 -std=c++14 -c -o test_exception_main.o bug.cpp && echo OK || echo
FAIL
OK
$ clang++-10 -std=c++14 -c -o test_exception_main.o bug.cpp  && echo OK || echo
FAIL
bug.cpp:10:16: error: parameter declarator cannot be qualified
a::e f(a::e(a::d));
            ~~~^
1 error generated.
FAIL

gcc bug, clang bug or known ambiguity? Looks like clang does not see a::d as an
enum value.

-- 
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/20200826/77764feb/attachment.html>


More information about the llvm-bugs mailing list