error: use of undeclared identifier

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

error: use of undeclared identifier

Rene Rebe
Hi all,

I spotted another issue, somehow related to name lookup, again reduced from real world code:

void test (bool gross)
{
  struct compare_and_set
  {
    void operator() (const bool inner, const bool gross = false)
    {
      // the code
    }
  } compare_and_set2;

  compare_and_set2 (false, gross);
}

test.cc:11:28: error: use of undeclared identifier 'gross'
  compare_and_set2 (false, gross);
                           ^
1 diagnostic generated.

Either renaming the outer, the argument gross or removing the first argument of operator() makes it compile with clang++, ,too.

Haven't found a match in bugzilla, either.

  René

--
  René Rebe, ExactCODE GmbH, Jaegerstr. 67, DE-10117 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.name


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: error: use of undeclared identifier

Douglas Gregor

On Feb 19, 2010, at 5:44 AM, Rene Rebe wrote:

> Hi all,
>
> I spotted another issue, somehow related to name lookup, again reduced from real world code:
>
> void test (bool gross)
> {
>  struct compare_and_set
>  {
>    void operator() (const bool inner, const bool gross = false)
>    {
>      // the code
>    }
>  } compare_and_set2;
>
>  compare_and_set2 (false, gross);
> }
>
> test.cc:11:28: error: use of undeclared identifier 'gross'
>  compare_and_set2 (false, gross);
>                           ^
> 1 diagnostic generated.
>
> Either renaming the outer, the argument gross or removing the first argument of operator() makes it compile with clang++, ,too.
>
> Haven't found a match in bugzilla, either.

Also strange, and possibly related to the previous error you reported. Again, please file a Bugzilla.

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: error: use of undeclared identifier

Rene Rebe
On 19.02.2010, at 20:01, Douglas Gregor wrote:

> On Feb 19, 2010, at 5:44 AM, Rene Rebe wrote:
>
>> Hi all,
>>
>> I spotted another issue, somehow related to name lookup, again reduced from real world code:
>>
>> void test (bool gross)
>> {
>> struct compare_and_set
>> {
>>   void operator() (const bool inner, const bool gross = false)
>>   {
>>     // the code
>>   }
>> } compare_and_set2;
>>
>> compare_and_set2 (false, gross);
>> }
>>
>> test.cc:11:28: error: use of undeclared identifier 'gross'
>> compare_and_set2 (false, gross);
>>                          ^
>> 1 diagnostic generated.
>>
>> Either renaming the outer, the argument gross or removing the first argument of operator() makes it compile with clang++, ,too.
>>
>> Haven't found a match in bugzilla, either.
>
> Also strange, and possibly related to the previous error you reported. Again, please file a Bugzilla.
>
> - Doug


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

--
  René Rebe, ExactCODE GmbH, Jaegerstr. 67, DE-10117 Berlin
  http://exactcode.com | http://t2-project.org | http://rene.rebe.name


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev