Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

won't compile on FreeBSD CLANG version 3.4.1 #9

Closed
vikingsloth opened this issue Jan 19, 2015 · 12 comments
Closed

won't compile on FreeBSD CLANG version 3.4.1 #9

vikingsloth opened this issue Jan 19, 2015 · 12 comments

Comments

@vikingsloth
Copy link

c++ -g -O2 -D_BSD_SOURCE -DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP -DHAVE_SOCKADDR_SA_LEN -I.. -I/usr/local/include -std=c++11 -c log_queue.cpp
In file included from log_queue.cpp:8:
../utils/concurrentqueue.hpp:1622:65: error: expected expression
  ...auto newBlock = this->parent->requisition_block();
                                                                ^
../utils/concurrentqueue.hpp:1828:65: error: expected expression
  ...auto newBlock = this->parent->requisition_block();
                                                                ^
../utils/concurrentqueue.hpp:2214:64: error: expected expression
  ...auto newBlock = this->parent->requisition_block();
                                                                ^
../utils/concurrentqueue.hpp:2363:159: error: expected expression
  ...|| (newBlock = this->parent->requisition_block()) == nullptr) {
                                                               ^

The arrow is pointing to the last brace in "();".

@cameron314
Copy link
Owner

Thanks for opening an issue! Unfortunately, I don't have the software installed to reproduce this. If you add template ConcurrentQueue:: before the method calls, does it resolve the issue?

Example:

auto newBlock = this->parent->template ConcurrentQueue::requisition_block<allocMode>();

@vikingsloth
Copy link
Author

Thanks. I got it to compile like this:

auto newBlock = this->parent->template requisition_block();

@cameron314
Copy link
Owner

Hmm, there should be template parameter of <allocMode> before the (). The line you've posted shouldn't compile(!).

Also, does the fully-qualified variant that I posted (template ConcurrentQueue::requisition_block<allocMode>()) compile as well? Because that one's to be preferred in order to avoid clashes with global symbols named requisition_block with certain compilers.

@cameron314
Copy link
Owner

Oops, sorry for the issue close/open spam, I hit the wrong button twice ><

@vikingsloth
Copy link
Author

It was a typo. Here's cut and pasted from the modified file

 auto newBlock = this->parent->template requisition_block();

@vikingsloth
Copy link
Author

Oh, it's the html stripping code in github removing it

@cameron314
Copy link
Owner

Oh! Weird, usually it leaves code blocks alone. OK, one mystery solved :-)
Does the fully-qualified version work for you too?

@vikingsloth
Copy link
Author

auto newBlock = this->parent->template requisition_block<allocMode>();

@vikingsloth
Copy link
Author

Fully qualified didn't work.

../utils/concurrentqueue.hpp:1622:60: error: expected ';' at end of declaration
  ...auto newBlock = this->parent->template ConcurrentQueue::requisition_bloc...
                                                           ^
                                                           ;
../utils/concurrentqueue.hpp:1622:60: error: no template named
      'requisition_block' in the global namespace; did you mean simply
      'requisition_block'?
  ...newBlock = this->parent->template ConcurrentQueue::requisition_block<all...
                                                      ^~~~~~~~~~~~~~~~~~~
                                                      requisition_block
../utils/concurrentqueue.hpp:2777:9: note: 'requisition_block' declared here
        Block* requisition_block()

@cameron314
Copy link
Owner

Oops, I must be getting tired. I put the template in the wrong spot, sorry. This should work:

auto newBlock = this->parent->ConcurrentQueue::template requisition_block<allocMode>();

@vikingsloth
Copy link
Author

Compiles cleanly with that as well

@cameron314
Copy link
Owner

Perfect, thanks a lot for your help. I'll commit a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants