[cfe-dev] error: parameter declarator cannot be qualified

Артем Зуйков chertus at gmail.com
Fri Aug 10 13:47:41 PDT 2012


Hi,

What do you think about this code and clang reaction?

struct A
{
   static const char * a;
};

const char * A::a = "O.o";

struct B
{
   B(const char * s);
};

struct C
{
   C(B& b);
};

class Problem
{
public:
   void foo()
   {
      C c(B(A::a)); // error here
   }
};


> clang++ x.cpp
x.cpp:23:6: warning: parentheses were disambiguated as a function declarator
[-Wvexing-parse]
C c(B(A::a)); // error here
^~~~~~~~~
x.cpp:23:12: error: parameter declarator cannot be qualified
C c(B(A::a)); // error here
~~~^
1 warning and 1 error generated.

> clang -v
FreeBSD clang version 3.1 (branches/release_31 156863) 20120523
Target: x86_64-unknown-freebsd9.0
Thread model: posix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120811/a4287dab/attachment.html>


More information about the cfe-dev mailing list