Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Compile fails with anonymous namespace CUB_NS_PREFIX #222

Closed
llehtahw opened this issue Oct 21, 2020 · 3 comments · Fixed by #225
Closed

Compile fails with anonymous namespace CUB_NS_PREFIX #222

llehtahw opened this issue Oct 21, 2020 · 3 comments · Fixed by #225
Assignees
Labels
P1: should have Necessary, but not critical. type: bug: functional Does not work as intended.
Milestone

Comments

@llehtahw
Copy link

reproduce:

#define CUB_NS_PREFIX namespace {
#define CUB_NS_POSTFIX }
#include <cub/cub.cuh>
int main()
{
        int res = (int)cub::Equals<int, int>::VALUE;
        return res;
}
/workspace/abc/a.cu(6): error: "cub" is ambiguous

/workspace/abc/a.cu(6): error: expected an identifier

/workspace/abc/a.cu(6): error: expected a ";"

Seems that these lines introduced the errors.

@alliepiper
Copy link
Collaborator

Can confirm:

1.8.0: https://www.godbolt.org/z/fjrP7K
main: https://www.godbolt.org/z/4K98Pc

We'll also need to add a test for this.

@alliepiper alliepiper added type: bug: functional Does not work as intended. P1: should have Necessary, but not critical. labels Oct 21, 2020
@alliepiper alliepiper added this to the 1.11.0 milestone Oct 21, 2020
@alliepiper alliepiper self-assigned this Oct 21, 2020
@elstehle
Copy link
Collaborator

elstehle commented Oct 21, 2020

I believe this is due to this one here. The doxygen declaration just ignores the macro.

/*! \namespace cub
* \brief \p cub is the top-level namespace which contains all CUB
* functions and types.
*/
namespace cub
{
}

I have had a fix for this a few months ago but forgot to push upstream. It got lost with repo move now. I can contribute later tonight, unless you want to take it on, @allisonvacanti

@alliepiper
Copy link
Collaborator

Awesome -- Contributions are more than welcome. I probably wouldn't get to this for a couple of days, so if you have a branch ready to push, go for it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1: should have Necessary, but not critical. type: bug: functional Does not work as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants