Skip to content

Instantly share code, notes, and snippets.

@lemire
Created July 27, 2019 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lemire/d442fb2a9763e53c44055c1d02a3378f to your computer and use it in GitHub Desktop.
Save lemire/d442fb2a9763e53c44055c1d02a3378f to your computer and use it in GitHub Desktop.
LLVM, attribute push and namespace... bad interactions?
// the following works fine under clang:
#pragma clang attribute push(__attribute__((target("sse4.2,pclmul"))), apply_to=function)
void f(){}
#pragma clang attribute pop
////////////
/// The following DOES NOT WORK: 'error: expected unqualified-id'
//////////
namespace joe {
#pragma clang attribute push(__attribute__((target("sse4.2,pclmul"))), apply_to=function)
void g() {}
#pragma clang attribute pop
}
int main() {
g();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment