- This distinguishes between whether a function has constexpr specified and if a function is implicitly constexpr (implicitly inline).
- This also gives the ability to mark a function concept as implicitly constexpr (and implicitly inline)
Details
Diff Detail
- Build Status
Buildable 1434 Build 1434: arc lint + arc unit
Event Timeline
include/clang/AST/Decl.h | ||
---|---|---|
1915 | How is the inline property transmitted here? Why does the setImplicitlyConstexpr function need to call setImplicitlyInline? | |
1919 | The quote does not seem to be pertinent here. Maybe have it a few lines down? | |
1923 | I am quite sure this is not the right thing to do when IC is false. | |
lib/Sema/SemaDecl.cpp | ||
8085 | The parenthetical here seems to be no longer needed. | |
9107 | This reads wrong to me. I get that the idea is that the function should not be semantically considered constexpr, but the choice of setImplicitlyConstexpr seems odd. | |
test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p2.cpp | ||
21 | This does not strike me as being very portable (I may be mistaken about how clang -cc1 works though). I think it would be much safer to use char [8] here (and in general for the size matching). |
include/clang/AST/Decl.h | ||
---|---|---|
1915 | inline isn't really transmitted here. When we create a FunctionDecl in CreateNewFunctionDecl we could use this rather than passing isConstexpr as a parameter to the constructor. setImplicitlyConstexpr is intended to be used downstream such as in ActOnFunctionDeclarator or CheckExplicitlyDefaultedSpecialMember. | |
1919 | Sorry, can you point to where you're thinking below? | |
1923 | Good point. I could do if (IC) setImplicitlyInline();, but that doesn't seem great with these smaller functions. Any suggestions by you or @rsmith would be great! | |
lib/Sema/SemaDecl.cpp | ||
8085 | I'll remove it. | |
9107 | Hmm, I'm not sure if we should keep around setConstexpr to handle cases either... Do you or @rsmith have any opinion? | |
test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p2.cpp | ||
21 | Yeah, good point. I'll fix this. |
- Initialize IsConstexprSpecified
- Remove unnecessary parenthetical in comment
- Fix non-portable test
include/clang/AST/Decl.h | ||
---|---|---|
1923 | Doing something automatic here with the inline specifier is turning out to be too complex. Instead, let's just remove the setImplicitlyInline() call from here and call it explicitly when handling a concept. |
- Remove the call to setImplicitlyInline() within setImplicitlyConstexpr() and call setImplicitlyInline() directly for function concepts.
How is the inline property transmitted here? Why does the setImplicitlyConstexpr function need to call setImplicitlyInline?